Repository navigation
fix: settle pending data track sends when the Room disconnects - #87
Merged
Merged
Conversation
charliesantos
requested changes
Nov 12, 2026
charliesantos
left a comment
Collaborator
There was a problem hiding this comment.
The fix looks right; one ordering issue on the disconnect settle path, inline.
| // End every frames() iterator and settle pending data track sends | ||
| // before surfacing the event, so neither hangs on a dead Room. | ||
| this._tracks.releaseAllRemoteTracks(); | ||
| this._releaseDataTracks('Room disconnected before the send completed'); |
Collaborator
There was a problem hiding this comment.
Settling inline here can drop a send result already queued on the track's AsyncContext (the two queues are unordered), so a delivered message resolves ok: false. Dispatch the settle through the track's asyncContext_ so queued results drain first.
Collaborator
Author
There was a problem hiding this comment.
Thanks! The settle is now dispatched on the track's AsyncContext, so queued results drain first. This also fixes the same race in room.dispose()
A LocalDataTrack.send() pending when the Room emits disconnected now resolves with ok: false without waiting for room.dispose(), and a send made afterwards resolves with ok: false at once instead of reporting success.
luisrivas
force-pushed
the
VBLOCKS-7580-send-settles-on-disconnect
branch
from
November 12, 2026 22:38
cf8f624 to
205970f
Compare
charliesantos
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Details
Description
A
LocalDataTrack.send()pending when the Room disconnects now resolves withok: falsewithout waiting forroom.dispose(). A send after the disconnect resolves withok: falseat once instead of reporting success.Public API changes
None to the types.
send()now resolves withok: falseafter the track's last Room disconnects.Burndown
Before review
CHANGELOG.mdunder the unreleased heading if the change is user-visiblenpm run lintandnpm test