snapshotProcessor modifies the type it wraps #1897
Labels
bug
Confirmed bug
help/PR welcome
Help/Pull request from contributors to fix the issue is welcome
level: intermediate
Bug report
Sandbox link or minimal reproduction code
Describe the expected behavior
types.snapshotProcessor
should not modify the type it is wrapping. This expectation is based on the semantics of the API as well as the documentation.Describe the observed behavior
When a model instance is created from a type returned by
types.snapshotProcessor
, the type being wrapped is modified. The create function of the type being wrapped is modified to behave the same as the create function of the type wrapping it.Notes
I tracked this down to
SnapshotProcessor._fixNode
which is called bySnapshotProcessor.instantiate
.SnapshotProcessor._fixNode
callsproxyNodeTypeMethods(node.type, this, "create")
.Where
node.type
is the type being wrapped andthis
is the type created bysnapshotProcessor
.I haven't looked further to figure out why/if this proxy of create is required.
The text was updated successfully, but these errors were encountered: