Fix: Swallow AbortError from interrupted video play() - #365
Draft
posthog-eu[bot] wants to merge 1 commit into
Draft
posthog-eu[bot] wants to merge 1 commit into
posthog-eu[bot] wants to merge 1 commit into
Conversation
The renderer's imperative HTMLVideoElement.play() in VideoPlayer runs while react-player also drives the same element through the `playing` prop. A pause or a new source load can abort the pending play, which rejects with a DOMException AbortError. The call did not handle the returned promise, so each rejection became an unhandled rejection that exception autocapture recorded as a false error tracking issue. Attach a catch that ignores AbortError and rethrows any other error so real media failures still surface. The video keeps following the shared playback state, so there is no user-visible change. Generated-By: PostHog Desktop Task-Id: 40f0602d-da23-48e6-9a22-b655112375ce
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
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.
Problem
HTMLVideoElement.play()imperatively while react-player also drives the same element throughplaying={isPlaying}. Apause()or a new source load aborts the pending play, which rejects withDOMException: AbortError. The returned promise was not handled, so each rejection became an unhandled rejection captured ashandled: false.Changes
play()inpackages/video/src/client/VideoPlayer/VideoPlayer.tsx: attach acatchthat ignoresAbortErrorand rethrows any other error, so genuine media failures still surface.Scope note
plugins/video-player/view/Remote/VideoCard.tsx:80for the same guard. That line callsvideoControls.play(), which only mutates shared valtio state and returnsvoid— it never touches a media element and cannot produce this rejection. The two error-tracking issues areAbortErrors from a mediaplay(), and the only imperative mediaplay()in the codebase is the one fixed here. So no change is needed at that call site.Testing
node_modulesabsent), so lint, typecheck, and build were not run here. The change is a singlecatchon an existing call; please let CI verify.Created with PostHog Desktop from this inbox report.