-
Notifications
You must be signed in to change notification settings - Fork 74
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
mergeCollection
: discrepancy between cache & storage behaviours
#514
Comments
The issue lies here: Lines 1531 to 1540 in 4f9cebf
When calling However, since the existing data holds a value under react-native-onyx/lib/storage/providers/IDBKeyVal.ts Lines 28 to 30 in 4f9cebf
|
I've put up a draft PR with a unit test to cover this issue, and a potential fix: #515
Test case:
mergeCollection
operation:Check the data processed in
IDBKeyVal.multiMerge
.Expected:
The data persisted in the Storage must be the same as the cached data.
Actual:
Storage persists the following data:
This causes the following bug: after the operation is complete, the
pendingFields
are reset correctly (because the subscriber callback is called with the cached data), but after the page is refreshed, thependingFields
are fetched from the Storage and showwaypoints: "add"
.The text was updated successfully, but these errors were encountered: