Skip to content

fix(extension): release failed camera preview connections - #3443

Open
vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/extension-preview-connection-cleanup
Open

vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/extension-preview-connection-cleanup

Conversation

@vedanth-jadhav

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

Copy link
Copy Markdown

Camera preview negotiation in both the iframe preview and parent picture-in-picture path can fail before the caller receives its peer. Offer/description/messaging failures leave that peer open, and the separate remote-stream promise can reject without a handler while negotiation is still pending. Failed answer application can also strand an already-received track.

Share connection ownership between both paths. On failure, close the local peer and stop any early remote tracks. Remove temporary track/connection listeners and the timeout on every settlement. Represent the remote wait as an outcome so an early timeout cannot become an unhandled rejection while setup is awaited; preserve the actual setup failure. Successful peers and streams still pass to the existing caller cleanup.

Validation: all 50 extension tests pass, including 11 new connection cases. Eight initial regressions fail against the extracted original implementation. Covers offer/local-description/messaging/remote-description failures, rejected or missing answers, track timeout, failed connection, early-track cleanup, a timeout preceding a later setup failure, and successful ownership transfer. Strict scoped helper/test TypeScript with Chrome types and noUncheckedIndexedAccess, Biome on all four files and diff checks pass.

Reproduce: cd apps/chrome-extension && bun run test.

Tests control WebRTC peers/events and Chrome messaging. Physical camera capture, real ICE negotiation, full extension build/typecheck and browser installation were not run. Existing caller disposal and reconnect policies remain in place; no dependencies or message contracts change.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Both camera preview paths now use connectCameraPreview to share cleanup.

  • Camera preview setup now cleans up failed connections in both preview paths.

No actionable issues were found. Tests and browser capture were not run during this review.

Reviews (1) · Last reviewed commit: "fix(extension): release failed camera pr..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 27, 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 27, 2026 1:35am UTC

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

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 6d6805d8 Deployed Oct 27, 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