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

fix(document): handle setting array to itself after saving and pushing a new value #12672

Merged
merged 1 commit into from Nov 12, 2022

Conversation

vkarpov15
Copy link
Collaborator

Fix #12656

Summary

We added some tracking of what the "saved state" of a document is in #9396 and #10773, but #12656 pointed out that we're not actually storing this saved state correctly when the first operation is a push(). Thankfully, #11644 makes this a bit easier: we can copy the state in markModified().

Hopefully this is all we need, but we may want to consider tracking savedState by just cloning the document when the document is saved or loaded. That is easier from an implementation perspective, but bad from a performance perspective. I would prefer to not have to do that.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vkarpov15 vkarpov15 merged commit d98b285 into master Nov 12, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12656 branch November 12, 2022 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data loss pushing items to list when sorting list and saving multiple times
2 participants