[DO NOT MERGE] bug: StateProxy
prevents modification of object array properties
#1130
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.
context
this PR is purely to document a bug I noticed and went pretty deep to try and fix, but had did not resolve at time of writing
the high-level error was surfacing as this:
this was fixed in #1127 by removing that code path, but the root-cause of it may still cause issues in the future? tbd
StateProxy
StateProxy
uses JS Proxy's to give us redo/undo operations on objectsfrom my understanding
StateProxy.create(obj)
basically returnsobj
with some extra methods on ityou can still modify
obj
's properties as you'd expect, for example:the bug
if an object has a pre-existing array property, however, that property seems to silently fail to be modified?
i didn't test deeper if this was an issue specific to
StateProxy
s (something custom to Spyglass) or JS'sProxy
's generally, but am dropping investigation on this for now since #1127 fixes the original bug i was looking into anyway