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.
The basics
npm run format
andnpm run lint
The details
Resolves
Fixes N/A
Proposed Changes
Switches change events (i.e. for mutations) to use full serialization.
Reason for Changes
I am reasonably sure this is the behavior it should have. But I needed to do a lot of playing with the shared procedure blocks to be confident.
Events are built for two use cases:
If we don't do full serialization then (1) breaks. E.g. in the shared procedure blocks change events will not be fired when the blocks mutate because their extra state isn't changing (their just serializing the same procedure ID). (2) is still fine because mirroring the procedure model updates updates the blocks.
With full serialization, (2) is a bit tricky because you need to mirror the changes to blocks and makes sure /not/ to mirror the changes to data models. If you mirror both, the block will be mirrored and create a new data model, and then the original data model will be mirrored (so you end up with an extra data model).
Note that we can't have the block create a data model with the same ID because we don't want copy-pasted blocks to point at the same procedure model as their originator.
Also note that the trickiness /currently/ applies to the released code where
doFullSerialization
doesn't exist. This change doesn't make mirroring better or worse than the released code. But it does make it trickier than the unreleased code :PTest Coverage
N/A
Documentation
N/A
Additional Information
N/A