Skip to content

Ensure that sortPresets does NOT mutate values passed in via options into Room#1979

Open
1egoman wants to merge 2 commits into
mainfrom
simulcast-layer-reorder
Open

Ensure that sortPresets does NOT mutate values passed in via options into Room#1979
1egoman wants to merge 2 commits into
mainfrom
simulcast-layer-reorder

Conversation

@1egoman

@1egoman 1egoman commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What could happen previously is if the user passed in the layers into LiveKitRoom in components-js in the wrong order, then the JSON.stringify(...) comparison here could be attempting to compare the sorted (via side effect) version with the new value the user passed in (which has a different ref and would not be sorted), always recreating the room on every render.

Fixes livekit/components-js#1345

Todo

  • Test this thoroughly to make sure nothing else depends on this implicit sorting behavior

…ions into Room

What could happen previously is if the user passed in the layers into
LiveKitRoom in components-js in the wrong order, then the JSON.stringify
comparisons which were being done at that layer could be attempting to
compare the sorted (via side effect) version with the new value the user
passed in (which has a different ref and would not be sorted), always
recreating the room.
@changeset-bot

changeset-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 53e5575

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

This PR includes changesets to release 1 package
Name Type
livekit-client 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

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 100.56 KB (+0.08% 🔺)
dist/livekit-client.umd.js 109.54 KB (-0.01% 🔽)

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.

Unexpected room reconnect when publishing video with custom simulcast layers

1 participant