Fix: Remove nullish values on set and on merge when no value is in storage#292
Conversation
|
To give another explanation to the issue at hand: Calling
Where as, when... Calling
First of all, this is inconsistent behaviour, and secondly in the app code we don't expect the |
mountiny
left a comment
There was a problem hiding this comment.
Looking good but also tagging Marc and Tim for review
tgolen
left a comment
There was a problem hiding this comment.
Left some comments to hopefully help the comments to be more clear to others.
marcaaron
left a comment
There was a problem hiding this comment.
Code LGTM. Agree with most of Tim's comments and think we could explain this edge case a bit better with some inline comments. @hannojg's description of the problem was very clear to me so maybe it can be incorporated somehow.
|
Awaiting another round of review, are we good to continue? This is blocking: |
tgolen
left a comment
There was a problem hiding this comment.
Love the comments. Very clear now. Thank you!
@tgolen @marcaaron @hannojg
In the native implementation with SQLite, the first call to
mergeon a key where no value is in storage will act like a regularsetsince the values are inserted into storage directly.This is due to this SQLite operation in
SQLiteStorage.mergeItem:In order for this to be consistent with how later
mergewithJSON_PATCHare working, we need to remove nullish values from thebatchedChangedin the first merge operation.Additionally, we'll want to remove nullish values on
setas well, so that the values in cache and storage are always identical.Details
Related Issues
Automated Tests
Linked PRs