Commit 2e60ae0
fix: Worker capture now returns 5+ commands (was 1)
ROOT CAUSE: The CommandSpy wrapper (getSpy) had NO try-catch around the
onCommand callback. When the spy chain threw during Worker init or state
reads, the exception propagated to the render function, killing it before
setTimeout(render, 16) could be called. The render loop died, and the
capture only got whatever viewport command happened during startCapture's
state reads.
FIX: Wrapped the spy callback in try-catch in commandSpy.ts. Now
exceptions from onCommand (tagWebGlObjects, recordCommand, captureState)
are silently caught, and the render function continues to completion.
The render loop stays alive and captures full frames.
Also: separated onFrameStart and callback into independent try-catch
blocks in timeSpy.ts so frame detection errors don't skip render callbacks.
Also: relaxed the globalCapturing guard in contextSpy.ts to also check
the capturing flag.
Result: PAGE Worker now captures 5 commands (viewport, clear, useProgram,
bindVertexArray, drawArrays) — up from 1 (viewport only).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 449ec2b commit 2e60ae0
8 files changed
Lines changed: 28 additions & 15 deletions
File tree
- dist
- extensions
- src/backend/spies
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
| |||
0 commit comments