Commit 5d92448
committed
Prevent Playback WebGL status events from reentering Unity
Playback status is exposed as a browser event for website integration. If a host page or injected listener synchronously calls THUAI9Unity APIs while handling that status event, Unity can immediately SendMessage back into itself and emit another forced status event on the same JavaScript stack. Dispatching playback status on the next browser task and suppressing identical forced payloads breaks that loop without changing the public website API.
Constraint: Keep existing website-facing THUAI9Unity and thuai9-playback-status APIs compatible
Rejected: Remove playback-status events entirely | website integrations still need status updates
Rejected: Make all Unity events asynchronous | playback-loading must stay ordered before the actual load call
Confidence: high
Scope-risk: narrow
Directive: Do not let identical playback-status payloads bypass de-duplication, even for command responses
Tested: Unity Playback WebGL build completed successfully
Tested: CDP-injected status listener synchronously calling THUAI9Unity.play no longer triggers RangeError
Tested: Query-url load of latest truncated playback reports 11865 loaded frames with incomplete-tail warning
Tested: Latest v9 and old v7 playback samples still parse through MessageReader
Tested: Unity-Playback-WebGL.zip matches playback directory SHA256 for all 17 files
Tested: dotnet format whitespace Unity-Playback scripts --verify-no-changes
Tested: WebGL root/live/playback/trial HTTP smoke returned 200 from interface Unity-WebGL root
Not-tested: Manual click test in the user's exact browser profile1 parent 21dfc16 commit 5d92448
6 files changed
Lines changed: 14 additions & 4 deletions
File tree
- interface/Unity
- Unity-Playback/Assets
- Plugins/WebGL
- Scripts/WebGL
- Unity-WebGL
- playback/Build
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
120 | | - | |
121 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| |||
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
0 commit comments