Skip to content

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

Merged
1egoman merged 2 commits into
mainfrom
simulcast-layer-reorder
Jun 22, 2026
Merged

Ensure that sortPresets does NOT mutate values passed in via options into Room#1979
1egoman merged 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

…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% 🔽)

@lukasIO lukasIO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@1egoman 1egoman merged commit 4d13aff into main Jun 22, 2026
7 checks passed
@1egoman 1egoman deleted the simulcast-layer-reorder branch June 22, 2026 13:59
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

2 participants