i modded quoted code a bit to focus on the issue:
"taylorcw" wrote:
globalNode = screen.getGlobalNode()
globalNode.addFields( {accessToken: []} )
globalNode.accessToken.Push("testing_123")
Right, that won't work as expected. The reason being that when you access RSG node field, a copy is being made and that's what the operation works on. The globalNode is a Node - and even as using dot-notation seems like a garden-variety assoc.array access - it isn't. It does not return "the" references to the stored object, it returns "a" reference to a deep-copy of it - with all consequences from that, like being unable to mutate the original or the copy being slow.
When evaluating above expression `globalNode.accessToken.Push("testing_123")`, first a copy of accessToken content is made, then .push() is called on it, which appends the new value - and on completion of the operation, the array is dropped (de-referenced and thus GC'd), as if that call were [].push("testing_123").
See this discussed more in e.g.
https://forums.roku.com/viewtopic.php?f ... 27#p533825 There is no single elegant workaround. Depending on the use case, sometimes it's better to replace nested structures of roArray/roAA with hierarchical Node structures. I.e. translate roAA into node fields (cue addFields()) and roArray into children (cue addChildren()).