Repository navigation
fix(sdk-recorder): save video after the camera source ends - #2971
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
If a camera-only recording's source ends with its microphone disabled, pressing Stop waits forever and strands the recorded video. Observe native completion when recording starts, then await that completion before uploading. This handles a stop event that already fired while also preserving final chunks when native state becomes inactive before the events arrive.
Closes #2970.
stopping; no HTTP callscomplete; all 9,343 buffered bytes reach uploadSix final-patch Chromium replays cover both event orderings, paused recording and normal Stop. Every upload matches all emitted native chunks byte for byte; all outputs decode without errors as 320×180 VP9, with 21 or 51 frames. The 1.7 s pending-event case uploads all 25,672 bytes. This used the actual SDK, native MediaRecorder and multipart client with a canvas video source and local HTTP response fixtures. No physical camera disconnect or authenticated cloud upload was run.
Validation: the completed-source regressions fail on main; all 27 SDK tests pass after the fix, including recording/paused cases with final data and stop events still pending. The pending-event cases check that upload waits and includes the final chunk. Scoped Biome passes. Strict SDK typechecking reproduces the same pre-existing event-handler variance error on main and this branch, tracked in #2915 with active fix #2917. This patch does not include that typing change or the separately reported paused-duration issue.


Confidence Score: 5/5
The PR appears safe to merge.Summary
The SDK now observes native completion when recording starts. Stop waits for that completion before uploading, even when the camera source has already ended.
AksharP5 explicitly leaves the existing event-handler typing error and paused-duration issue outside this patch.
Reviews (1) · Last reviewed commit: "fix(sdk-recorder): save video after the ..." · Reviewed by Greptile