8000 fix(deck): one voice session at a time, so dictation is not repeated by simon-inkie · Pull Request #72 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content

fix(deck): one voice session at a time, so dictation is not repeated - #72

Merged
simon-inkie merged 1 commit into
mainfrom
fix/voice-single-session
Oct 20, 2026
Merged

simon-inkie merged 1 commit into
mainfrom
fix/voice-single-session

Conversation

@simon-inkie
Copy link
Copy Markdown
Owner

Clicking the mic while it was still connecting started a second voice session, so every live socket inserted every transcript final and dictation came out doubled.

  • liveRef lock: a click while connecting cancels the pending start
  • sessionIdRef: an in-flight start drops its stream if it was cancelled
  • each socket listener ignores events unless it is still the current socket
  • new connecting state: spinner, aria-busy, cancel label

Adds a jsdom test (getUserMedia, WebSocket and MediaRecorder stubbed). Opus review: MERGE, no Critical or Major. Two extra tests suggested (unmount during start, permission denial).

toggleMic only refused a new session once status was "active", which is
set after getUserMedia and the socket open. Clicks while connecting each
started another session and overwrote the refs, orphaning the older ones;
every live socket then inserted every Deepgram final.

- liveRef lock: a click while connecting cancels the pending start
- sessionIdRef: an in-flight start drops its stream if it was cancelled
- each socket listener ignores events unless it is still wsRef.current
- release any leftover session before claiming the refs
- new "connecting" state: spinner, aria-busy, cancel label

Adds a jsdom test stubbing getUserMedia, WebSocket and MediaRecorder.
@simon-inkie
simon-inkie merged commit 28bda11 into main Oct 20, 2026
4 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.

1 participant

0