Commit ce13df5
fix: prevent stale stopRecording from nullifying new recorder
Adversarial user audit found: rapid hotkey presses (record→stop→record)
could cause stopRecording's `await recorder.stop()` to resolve after
a new startRecording created a fresh recorder. The old stopRecording
then set `recorderRef.current = null`, orphaning the new recorder
and leaving the app permanently stuck in recording state.
Fix: capture recorder in local variable at stopRecording start, release
recorderRef immediately. The awaited stop() operates on the local
reference, never touching the new recorder.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent bf0a8f2 commit ce13df5
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
155 | | - | |
156 | | - | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
0 commit comments