fix(scenegraph): report an alias field's own name in observer events - #1151
Merged
Conversation
observeField()/observeFieldScoped() on an interface alias field cached the alias's target field name into the resulting roSGNodeEvent instead of the alias's own declared name, so GetField() returned the wrong value and misrouted apps that dispatch on it by name. Co-Authored-By: Claude Sonnet 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.



Summary
observeField()/observeFieldScoped()on an interface alias field cached the alias's target field name into the resultingroSGNodeEventinstead of the alias's own declared name, soGetField()on the delivered event returned the wrong value.msg.GetField()against the alias's declared name (a common pattern for routing message-port events) would silently get misrouted to whatever handler matches the target field's name instead — producing behavior that diverges from a real Roku device, where the alias's own name is reported correctly.Node.addObservernow uses the alias's own declared name (alias.aliasName) when present, falling back to the field's own name otherwise. One-line change insrc/extensions/scenegraph/nodes/Node.ts.test/cli/resources/alias-observer-event-app/) that observes an alias field via a message port and asserts the delivered event reports the alias's own name, plus a matchingcli.test.jscase.Test plan
npm run lint— cleannpm run prettier:write— no unrelated changesnpm run build:cli && npm run build:sgnpx vitest run test/cli/cli.test.js -t "Alias"— new + existing alias tests passnpm test— full suite: 200 files / 2541 tests passing, no regressions🤖 Generated with Claude Code