Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate state tree instances instead of snapshots in the `SnapshotPr…
…ocessor.is` override (#2182) * Validate state tree instances instead of snapshots in the SnapshotProcessor.is override This fixes a bug where within `.is` on models with snapshot processors, we validated against the model snapshot, instead of the model node when given a node. This means that two different models with compatible snapshots would not `.is` instances of each other normally, but once a snapshot processor is added, they would. This adds a failing test capturing this case. The PR that introduced this behaviour of validating the snapshot was introduced here: #1495, and I think was actually targeting a different use case -- passing *snapshots* to `.is`, not passing instances. The behaviour that PR added was to validate against the __processed__ version of a snapshot if passed a snapshot, which this PR maintains. But, if passed an instance, that PR elected to snapshot it as well, which I don't think is necessary, and breaks the substitutability of snapshot processed instances with their unwrapped counterparts. * docs: bump JSdocon snapshotProcessor is * docs: one more link for snapshotProcessor * chore: version bump to 7.0.0-pre.1 --------- Co-authored-by: Tyler Scott Williams <tyler@coolsoftware.dev>
- Loading branch information