Skip to content

Harden share audio, networking, and security - #2

Draft
Dahhrk wants to merge 6 commits into
Mund0o:masterfrom
Dahhrk:fix/screen-share-audio-loopback
Draft

Harden share audio, networking, and security#2
Dahhrk wants to merge 6 commits into
Mund0o:masterfrom
Dahhrk:fix/screen-share-audio-loopback

Conversation

@Dahhrk

@Dahhrk Dahhrk commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep voice on the call track and share only isolated computer sound via AudioWorklet (Windows process-loopback exclusion; Linux PipeWire share sink).
  • On Windows without process exclusion, share video only — no endpoint-loopback fallback that could include Pair playback.
  • Wait for peer-connection signaling to return to stable before createOffer during share renegotiation; only log computer-sound success when renegotiation actually starts.
  • Linux: probe getUserMedia before enumerateDevices, and tear down the temporary PipeWire sink on cancel/generation abort.
  • Improve connection recovery with ICE restart, longer ICE gathering, STUN+TURN merge, and peer-left signaling when a roommate disconnects.
  • Remove hardcoded GIF API keys (use PAIR_GIPHY_KEY / PAIR_KLIPY_KEY), validate relayed signal payloads, and open only HTTPS external links.
  • Prefer hardware-friendly video codecs and milder default bitrates; strip verbose capture/diag noise unless PAIR_DEBUG=1.
  • Add npm test coverage for helpers, signaling, and call/share lifecycle guards; stop tracking build logs and addon build junk (keep the shipped .node).

Test plan

  • npm test passes
  • Voice call + screen share with computer sound: desktop audio shares, call voices do not loop into the share
  • Fresh Linux profile / share-without-call: computer sound attaches after permission probe
  • Stop sharing during Linux audio setup: default sink is restored
  • Older Windows without process-loopback: share is video-only (no endpoint fallback)
  • Drop one peer from a room and confirm the remaining peer gets a clean peer-left teardown
  • Interrupt network briefly and confirm ICE recovery attempt
  • Without GIF env keys, GIF search stays empty instead of using embedded credentials

Dahhrk added 2 commits August 5, 2026 02:44
Keep computer sound on the share track while voice stays on the call.
Windows process-loopback now passes stereo desktop audio through without
a soft canceller, and the UI makes that split explicit.
Add ICE recovery and peer-left signaling, prefer isolated stereo share
audio via AudioWorklet with an older-Windows endpoint fallback, remove
hardcoded GIF keys, validate relayed signal payloads, ship helper unit
tests, and stop tracking build junk.
@Dahhrk
Dahhrk force-pushed the fix/screen-share-audio-loopback branch from b08d291 to c0b7583 Compare August 5, 2026 01:51
@Dahhrk Dahhrk changed the title Prevent screen share audio from echoing call playback Harden share audio, networking, and security Aug 5, 2026
… load.

Prepare the computer-sound track before one renegotiate to avoid a second audio-only race, harden AudioWorklet loading, and improve endpoint-mode capture when call voice reference is available.

Co-authored-by: Cursor <cursoragent@cursor.com>
Mund0o added a commit that referenced this pull request Aug 5, 2026
Dahhrk and others added 3 commits August 5, 2026 03:11
Keep isolated share capture and single-renegotiate attach, and fold in upstream wait-for-stable renegotiation plus Linux share cleanup fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wait for stable signaling before claiming computer-sound success, probe Linux mic permission before PipeWire enumeration with generation-guarded sink teardown, and drop the Windows endpoint-loopback fallback in favor of video-only when process exclusion is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep loopback hardening and video-only fallback; take master call-audio isolation, screen gesture guard, and 1.1.24 package metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
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