-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cleanup #104
Comments
Same issue here |
It does the same thing on the websites live demo (you can see it immediately in the devtools for application/idb, though you need to reload the page to see the text get updated to reflect that the edits were lost). Since that example is one of the two live demos for the package, it should be pretty easy to use as a test case. Edit: The error is occurring inside the cleanupDoc function: Lines 215 to 226 in 257e0c8
This function checks whether the new doc has a field that has been set to undefined, but it doesn't check if any of the fields with values have been modified. Only when a field has been set to undefined are the differences between the old and new documents merged, resulting in any updated values to an existing field incorrectly falling through into the "duplicate update" case. |
I just try cleanup method on a test database, and it result on a deletion of all updates made.
Exemple:
First doc:
Update 1: prop1 true => false
Result a new document:
.all() result:
Execute .cleanup(),
.all() result:
And document "Update 1" (123+timestamp) as disappear from database.
The text was updated successfully, but these errors were encountered: