Don't attach the background blur processor to an ended camera track - #4231
Open
ara4n wants to merge 1 commit into
Open
Don't attach the background blur processor to an ended camera track#4231ara4n wants to merge 1 commit into
ara4n wants to merge 1 commit into
Conversation
If the camera track has already ended by the time the blur processor is
applied to it, MediaStreamTrackProcessor cannot be constructed and
setProcessor rejects. Both call sites used `void`, so this surfaced as
Unhandled promise rejection: TypeError: Failed to construct
'MediaStreamTrackProcessor': Input track cannot be ended
(element-call-rageshakes#17225). Skip ended tracks, and catch and log
processor attach/detach failures instead of leaking them.
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.
This is a lowish priority Fable-generated PR to go and remove logspam around rejected promises.
Content
trackProcessorSyncanduseTrackProcessorSynccalledvideoTrack.setProcessor(processor)withvoid. If the camera track has already ended, the blur processor'sMediaStreamTrackProcessorcannot be constructed and the promise rejects, which surfaces asBoth call sites now go through one
applyProcessorhelper that skips tracks whosemediaStreamTrack.readyStateisendedand catches and logs attach/detach failures.Motivation and context
Seen in element-call-rageshakes#17225 (Element Desktop, background blur on). Harmless to the user since the track was going away anyway, but it is an unhandled rejection at warning level that shows up when reading logs.
Tests
TrackProcessorContext.test.tscovering: attaches to a live track, skips an ended track, a rejectedsetProcessordoes not become an unhandled rejection, stops the processor when none is wanted.pnpm lint(tsc, oxlint, knip) clean.Checklist