fix(rsg): don't crash when a Task sets a node-valued field to invalid - #1102
Merged
Conversation
…invalid
Clearing a node field from a task (`m.top.payload = invalid`) sends an update
whose value is null — jsValueOf maps invalid to null. The render side read
`_address_` off that value to decide whether to reconcile against the node it
already held, so when the field currently held a node the read threw:
Cannot read properties of null (reading '_address_')
at Task.handleSetFieldRequest
The throw escapes processThreadUpdate and aborts the whole task-update pass,
so the task's later writes never land and an app waiting on them hangs.
Guard the address comparison. A null value now falls through to brsValueOf,
which yields invalid and clears the field as intended.
Present since the rendezvous thread-update implementation (#856).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Root cause
Clearing a node-valued field from a task —
m.top.payload = invalid— sends a thread update whose value isnull(jsValueOfmapsinvalidtonull). The render side reads_address_off that value to decide whether to reconcile against the node it already holds:When the field currently holds a node and the incoming value is
null, that throws:The throw escapes
processThreadUpdateand aborts the whole task-update pass, so the task's later writes never land and an app waiting on them hangs. Clearing a reference this way is ordinary — analytics and player plugins do it on teardown.Fix
Guard the address comparison. A null value falls through to
brsValueOf, which yieldsinvalidand clears the field as intended.Pre-existing
Present since the rendezvous thread-update implementation (#856, Feb 2026) — reproduced on clean
master, unrelated to the recent SceneGraph work. It is the only unguardedupdate.valueaccess in the file.Tests
New
task-clear-node-app+ acli.test.jscase: a task hands a node to the render thread, then clears it. Asserts the observer sees the node, theninvalid, then that the task still reaches completion.Confirmed the test catches the regression — reverting the one-character guard makes it fail with the original
TypeError.Verification
Clean
npm run clean && npm run build(0 TypeScript errors), lint and prettier clean.Full suite: 2239 passed, 2 failed — both
ECP query/r2d2-bitmaps, caused by another process holding port 8060 on the test machine (lsofshows Electron). Unrelated to this change; they pass when that port is free.🤖 Generated with Claude Code