mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
The native dictation forwarder now includes a monotonically increasing
session ID in every emitted event payload:
- Transcript events: { text: string, session: number }
- State events: { state: 'started'|'stopped', session: number }
start_dictation returns the session ID so the frontend stores it in
nativeSessionRef before registering listeners. Listeners compare the
event's session field against nativeSessionRef.current and ignore
mismatches, definitively preventing stale transcripts from a previous
session's forwarder from leaking into a new draft.
Also reordered the start flow: engine start (which returns the session ID)
now happens before listener registration, eliminating the timing gap where
listeners could accept events with an unknown session.