Commit 6a7d684
fix(video): make pause/resume race-free by routing through the new dispatcher
Replaces the inline switch in onRPCMessage with a pair of regular
RPCHandler entries flagged TakesSession + Synchronous. The dispatcher
runs them on the per-session rpcQueue pump goroutine — which is the
single sequential consumer of the queue — so a rapid pause→resume pair
can no longer be reordered by the Go scheduler. Previously each RPC
was dispatched via "go onRPCMessage(...)", letting the scheduler
interleave the two helpers so a release could land after the matching
acquire and leave the encoder stopped while the tab was visible.
Reported by Cursor Bugbot:
#1455 (comment)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 0326d1e commit 6a7d684
2 files changed
Lines changed: 18 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | 129 | | |
146 | 130 | | |
147 | 131 | | |
| |||
1381 | 1365 | | |
1382 | 1366 | | |
1383 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
1384 | 1370 | | |
1385 | 1371 | | |
1386 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
160 | 176 | | |
161 | 177 | | |
162 | 178 | | |
| |||
0 commit comments