Skip to content

fix(sdk-recorder): release capture after encoder failures - #3412

Open
vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/sdk-recorder-encoding-errors
Open

vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/sdk-recorder-encoding-errors

Conversation

@vedanth-jadhav

@vedanth-jadhav vedanth-jadhav commented Oct 26, 2026 •

Copy link
Copy Markdown

When a browser encoder raises MediaRecorder.error, the SDK stays in its recording/paused phase, retains the camera and microphone, and keeps its timers alive. If the failure happens while stopping, it can also upload the failed encoder's partial output.

Handle errors only for the current encoder, release capture and timers before notifying listeners, and transition to error once. Resolve the stop gate with the original error so a pending stop() rejects without uploading or creating an unhandled rejection. Late events from a destroyed/replaced encoder cannot affect the replacement. The listener-registration cast is reused for unsubscribe to fix the existing strict-TypeScript error while validating this source; this supporting change is identical to #3380/#3387.

Validation: all 41 SDK tests pass. Six new cases cover active/paused failures, timer cleanup, missing native error details, failure during stop, a late old-encoder error, and replacement from an error handler; five fail before the fix. Full SDK strict typecheck and ESM/declaration build, strict new-test typecheck, scoped Biome and diff checks pass.

Reproduce: bun test packages/sdk-recorder, then cd packages/sdk-recorder && bun run typecheck && bun run build.

This handles capture-time encoding errors; #3380 handles asynchronous upload ownership. Their combined 49-test suite and package typecheck also pass locally after combining their overlapping stop-gate changes. Browser media devices/events are controlled in tests; physical capture and codec failures were not exercised. No dependencies or public signatures change.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

The SDK now releases capture and timers when the current encoder fails.

  • Encoder failures release capture and make a waiting stop reject.
  • Listener unsubscribe keeps its existing behavior.

vedanth-jadhav explicitly assigns asynchronous upload ownership to #3380.

Reviews (1) · Last reviewed commit: "fix(sdk-recorder): release capture after..." · Reviewed by Greptile

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 26, 2026 18:01 Inactive
@vercel

vercel Bot commented Oct 26, 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 26, 2026 6:01pm UTC

CodeGovindz added a commit to CodeGovindz/receipts that referenced this pull request Oct 27, 2026
Covers the problem, the live app, how the pipeline and its guards work,
the three false alarms found on CapSoftware/Cap#3412 and how they were
fixed, how to use Receipts on the web, in Alan, from any MCP client and
from the command line, self-hosting on Vercel with a Bedrock-only IAM
policy, development scripts and limitations. Adds a screenshot of a
real report.
CodeGovindz added a commit to CodeGovindz/receipts that referenced this pull request Oct 27, 2026
- The web app ran every check twice: Next.js syncs history.replaceState
  into useSearchParams, so the ?pr= auto-run fired again after a manual
  run. Any run now marks the auto-run as done.
- The quote guard dropped real claims because the extraction model
  shortens long quotes with "...". Each "..." is now a gap: the remaining
  fragments must still appear in the PR text, in order, so invented
  quotes are still rejected. The prompt also asks for exact quotes.
  On CapSoftware/Cap#3412 this takes dropped claims from 5 to 0.
- Extraction output limit raised from 1000 to 3000 tokens; 12 claims
  could overflow it and force a retry.

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 92cc9220 Deployed Oct 26, 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.

1 participant