fix(scenegraph): keep m.global's own descendants out of its findNode search - #1096
Merged
Conversation
lvcabral
force-pushed
the
fix/global-node-parent
branch
from
July 28, 2026 22:55
ac28300 to
25138d5
Compare
…search Device-confirmed: a node appended to m.global is found by neither m.global.findNode() nor m.top.findNode(). findNode's search space is the subject node's nearest component ancestor; for the global node that is the Scene, and the global node itself sits outside the Scene's children, so its own subtree is not in that space. This engine searched the subject's own subtree first and found it. Skip that self-search for the global node. Every other node's subtree is part of its component ancestor's subtree anyway, so searching it first is only a shortcut and their behavior is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lvcabral
force-pushed
the
fix/global-findnode-own-subtree
branch
from
July 28, 2026 22:56
0f45874 to
3243948
Compare
|
This was referenced Jul 28, 2026
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
Device-confirmed: a node appended to
m.globalis found by neitherm.global.findNode()norm.top.findNode().findNode's search space is the subject node's nearest component ancestor. For the global node that is the Scene, and the global node itself sits outside the Scene's children — so its own subtree is not in that space. This engine searched the subject's own subtree first and found it.Fix
Skip that self-search for the global node. Every other node's subtree is part of its component ancestor's subtree anyway, so searching it first is only a shortcut; their behavior is unchanged.
m.global.findNode("GlobalOwnChild")invalidNode#GlobalOwnChildinvalidm.top.findNode("GlobalOwnChild")invalidinvalidinvalidNote this is a narrowing — an app that appended to
m.globaland relied on finding it would have been broken on a device already.Tests
GlobalFindNode.test.js— a node appended tom.globalis reachable from neither search.Full suite green (2222), lint and prettier clean.
🤖 Generated with Claude Code