Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mutator] setIfMissing messes with squashing #59

Closed
simen opened this issue Apr 11, 2017 · 0 comments
Closed

[mutator] setIfMissing messes with squashing #59

simen opened this issue Apr 11, 2017 · 0 comments

Comments

@simen
Copy link
Member

simen commented Apr 11, 2017

The mutator considers "setIfMissing" a non-squashable patch since it conceptually could change the shape of the document. This messes up squashing since Sanity always sends a set if missing patch before each delta patch. It is conceptually correct to squash setIfMissing patches as long as the resulting patch contains one of each setIfMissing when it first arrive.

[setIfMissing("field"), diffMatchPatch("field", ...), setIfMissing("field"), diffMatchPatch("field", ...), setIfMissing("field"), diffMatchPatch("field", ...)] can be squashed to [setIfMissing("field"), diffMatchPatch("field", ...)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants