Skip to content

fix(sdk-recorder): save video after the camera source ends - #2971

Merged
richiemcilroy merged 1 commit into
CapSoftware:mainfrom
AksharP5:sdk-camera-stop
Oct 23, 2026
Merged

richiemcilroy merged 1 commit into
CapSoftware:mainfrom
AksharP5:sdk-camera-stop

Conversation

@AksharP5

@AksharP5 AksharP5 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

Same real Chromium recording fixture Before After
Camera source ends, then Stop Pending after 800 ms; phase stopping; no HTTP calls Resolves; phase complete; all 9,343 buffered bytes reach upload
Source ends while paused, then Stop Same hang Resolves and uploads the buffered video
Source ends, then Stop runs before final native events Complete video Complete video, including the final 11,107-byte chunk in the 1.7 s replay
Normal manual Stop Completes Completes

Six 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.

RetriggerView in GreptileConfidence 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.

  • The recorder waits for native completion before uploading the video.

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

@vercel

vercel Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 23, 2026 5:15am UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 23, 2026 05:15 Inactive
@richiemcilroy
richiemcilroy merged commit c9b2939 into CapSoftware:main Oct 23, 2026
29 of 30 checks passed

This branch was previously deployed

1 inactive deployment
Preview – cap-status — cafef87e Deployed Oct 23, 2026 by vercel[bot]
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.

Camera-only SDK recordings cannot be saved after their source ends

2 participants