fix(session): make PTT holds idempotent and observable - #218
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed
press()idempotent while already active. A repeated/native duplicatePressededge can no longer mean "mute".Pressededges at the Tauri-event listener as well, so a repeat burst does not cause redundant renders orgetStats()work. The store keeps the same invariant independently as defence in depth.Releasededges without hard-coding the default binding.MediaStreamTrack.enabled/readyState, and outbound RTPbytesSent/packetsSentcounters and deltas.sessionStore.peers[*].ptttransitions and capture the matching receiver-side audio track state plus inbound RTPbytesReceived/packetsReceivedcounters. This lets two diagnostic logs distinguish sender mute/state failure, missing RTP transport, and receive/playback-side failure.Root cause
PR #168 made a second
press()while PTT was active an emergency mute, based on the assumption that the global-shortcut backend could never deliver anotherPressedduring one physical hold. Issue #209 reports a deterministic ~0.2 s hold threshold on macOS and, after checking with the other participant, no usable audio reached the peer. That makesPressed -> active=falseunsafe: a duplicate/repeated edge can disable the actual audio track while the key is still held.This change restores the correct hold-to-talk invariant: Pressed can activate PTT or be ignored; only Released, native physical-release recovery, reset, or the failsafe can deactivate it.
Diagnostics / privacy
The added logs intentionally do not contain peer IDs, session topics, device names, track IDs, codecs, IP/ICE addresses, SDP, microphone contents, or captured audio. They record only booleans, counts, durations, event sequence numbers, edge source, and aggregate RTP byte/packet counters through the existing structured/redacted logger. Debug records are written to
studyvis.logregardless of the developer-console debug preference, so exported diagnostics contain the PTT timeline without requiring a special reproduction mode.Media snapshots keep their nested sender/receiver counters below the logger's per-object key cap, so
bytesSent/bytesReceivedand their deltas are not silently truncated.Regression coverage
press()remains activeMAX_HOLD_MSgetStats()failures are non-fatal and countedManual verification target
On macOS Apple Silicon with a Windows/macOS peer:
ptt.edge.received, optionalptt.edge.duplicate_pressed, andptt.media.snapshotwith enabled/live sender + outbound counters.edgeSource=physical-watchmeans the native watcher recovered a release before Carbon did. Expected receiver records:ptt.peer.edge.receivedandptt.media.snapshotwith live receiver + inbound counters.Fixes #209