Skip to content

fix(react): keep chat stable with inline options - #1450

Open
fatihcvs wants to merge 1 commit into
livekit:mainfrom
fatihcvs:fix/chat-inline-options
Open

fatihcvs wants to merge 1 commit into
livekit:mainfrom
fatihcvs:fix/chat-inline-options

Conversation

@fatihcvs

Copy link
Copy Markdown
Contributor

Passing inline options such as useChat({ room }) recreates chat setup on every render. Resetting the message observable then updates state with a new empty array, triggering another render and setup. Equivalent options can therefore cause a render loop and discard message history.

Depend on the individual option values rather than the containing object, while retaining the existing room/disconnect reset behavior.

Validation:

  • Three hook regressions fail before the change (a bounded render guard prevents the test runner from hanging) and pass afterward. They cover inline default/custom-topic options, messages surviving a rerender, and history/subscriptions moving to a different room.
  • Tests use the real hook and SDK Room events in JSDOM, with no server connection or hook mocks.
  • 121 core/react/styles tests pass. pnpm build:react, React lint (warnings, no errors), pnpm format:check, and React API check pass.

Includes a React patch changeset. This is independent of #1449: it changes React option identity handling, not core per-topic registration. Developed and verified with OpenAI Codex assistance.

@changeset-bot

changeset-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 85945ac

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

@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

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.

1 participant