Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor calls to track.stop() during an ongoing restart attempt #1131

Merged
merged 4 commits into from
May 12, 2024

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented May 8, 2024

closes livekit/components-js#851

When calling track.stop() while a track.restart() is already ongoing, we'd end up with a dangling active mediastreamtrack.

This change makes sure that if stop is called during a restart we immediately stop the track again after the restart.

Alternatives considered:
An arguably cleaner solution would be to make the stop function async and await restartLock.lock, but that would potentially be a breaking change.

Copy link

changeset-bot bot commented May 8, 2024

🦋 Changeset detected

Latest commit: a3e9e06

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

Copy link
Contributor

github-actions bot commented May 8, 2024

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 79.74 KB (+0.08% 🔺)
dist/livekit-client.umd.js 85.41 KB (+0.08% 🔺)

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lg!

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lg!

@lukasIO lukasIO merged commit c38d133 into main May 12, 2024
3 checks passed
@lukasIO lukasIO deleted the lukas/honor-stop-during-restart branch May 12, 2024 18:35
@github-actions github-actions bot mentioned this pull request May 12, 2024
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.

<PreJoin not correctly stopping tracks after unmount
2 participants