Skip to content

fix(sdk-recorder): release capture before uploading - #3191

Merged
richiemcilroy merged 3 commits into
CapSoftware:mainfrom
AksharP5:sdk-capture-release
Oct 25, 2026
Merged

richiemcilroy merged 3 commits into
CapSoftware:mainfrom
AksharP5:sdk-capture-release

Conversation

@AksharP5

@AksharP5 AksharP5 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

After pressing Stop, SDK callers keep camera, microphone and screen capture active while the recording uploads. Capture now releases after the encoder delivers its final data, before video creation or multipart upload, without discarding recording chunks.

Closes #3190.

Same recording with video creation held pending Before After
Camera and microphone tracks at 150 ms and 1 s live ended
Paused recording stopped before upload Capture remains live Capture ended
Screen, system audio and microphone tracks live ended
Successful uploaded bytes All emitted chunks All emitted chunks

The existing encoder identity also protects a replacement recording when an old stop finishes after destroy/restart. The canceled stop rejects with AbortError before releasing tracks or uploading; stale data and source-ended callbacks cannot affect the replacement. Normal duration, upload results and errors retain their existing behavior.

All 35 SDK tests pass, including the capture-release and delayed-stop regressions. The suite now runs in CI. Independent Astra HIGH review approved the final patch and passed five additional ownership/error probes. Ten fresh native Chromium runs compare the original base and final runtime; all eight successful recordings preserve their complete emitted bytes and decode cleanly. Delayed-stop cancellation is verified with controlled encoder events.

Scoped TypeScript retains the pre-existing unsubscribe TS2345. Biome and tsup are unavailable locally; the exact CI formatting correction is included. Final-head configured CI passes, including the 35-test SDK suite, repository typechecking, Biome format/lint, Mobile, Linux Rust tests, both Clippy jobs and the native desktop build matrix. Current-head Greptile is 5/5 with no unresolved findings. Vercel previews require team authorization. Physical devices, OS indicators, Firefox/Safari, mounted React, authenticated storage and the published tsup package were not tested. Destroy/restart after upload has already begun remains a separately reproduced pre-existing limitation.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous replacement-recording issue is fixed, and no new actionable issues were found.

Summary

Capture now ends after the encoder finishes and before upload begins.

  • Stopping a recording ends capture before the upload begins.
  • A delayed stop cannot interrupt a replacement recording.

Reviews (2) · Last reviewed commit: "fix(sdk-recorder): isolate canceled reco..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

@AksharP5 is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread packages/sdk-recorder/src/index.ts Outdated

Copy link
Copy Markdown
Contributor Author

@greptileai review current head d937565. The session-ownership P1 is corrected, including stale chunk/source callbacks and cancellation before upload. Three delayed-stop regressions fail on the previous revision; all 35 SDK tests pass. Astra HIGH R3 approved the exact head and five boundary probes. The prior Biome correction is also included; fresh CI is running.

@richiemcilroy
richiemcilroy merged commit a28e201 into CapSoftware:main Oct 25, 2026
33 of 35 checks passed
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.

SDK keeps capture active while uploading after Stop

2 participants