Skip to content

fix(react): match the URL scheme case-insensitively in chat links - #1505

Merged
lukasIO merged 1 commit into
livekit:mainfrom
RaphaelFakhri:fix/chat-link-scheme-case
Nov 4, 2026
Merged

lukasIO merged 1 commit into
livekit:mainfrom
RaphaelFakhri:fix/chat-link-scheme-case

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

Summary

formatChatMessageLinks adds https:// to a URL unless it already starts with http:// or https://. That check is case-sensitive, but the URL pattern that finds links is not. A message such as Https://livekit.io, which mobile keyboards produce by capitalizing the first word, gets the link https://Https://livekit.io, and the browser resolves it to https://https//livekit.io.

This change makes the check case-insensitive. Other schemes still get the https:// prefix, as before, so a link never uses a scheme other than http or https.

Changes

  • ChatEntry.tsx: match ^https?:// case-insensitively.
  • Add ChatEntry.test.tsx covering lowercase, mixed-case, uppercase, and scheme-less URLs.
  • Add a patch changeset for @livekit/components-react.

Testing

pnpm exec vitest --run src/components/ChatEntry.test.tsx in packages/react:

  • Without the fix: 2 failed, 2 passed (Https://livekit.io resolves to https://https//livekit.io).
  • With the fix: 4 passed.

Fixes #1504

@vercel

vercel Bot commented Nov 4, 2026

Copy link
Copy Markdown

@RaphaelFakhri is attempting to deploy a commit to the LiveKit Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e1cb6c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@livekit/components-react Patch
@livekit/agents-ui Patch
@livekit/component-example-next Patch
@livekit/components-js-docs Patch
@livekit/component-docs-storybook Patch
@livekit/components-docs-gen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukasIO
lukasIO merged commit 2a4e3fc into livekit:main Nov 4, 2026
3 of 4 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat links break when the URL scheme is not lowercase

2 participants