react-native-onyx 1.0.51 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web.development.js +12 -1
- package/dist/web.development.js.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/lib/Onyx.js +12 -1
- package/package.json +1 -1
package/dist/web.development.js
CHANGED
|
@@ -1213,14 +1213,25 @@ function mergeCollection(collectionKey, collection) {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
|
|
1215
1215
|
// Confirm all the collection keys belong to the same parent
|
|
1216
|
+
let hasCollectionKeyCheckFailed = false;
|
|
1216
1217
|
underscore__WEBPACK_IMPORTED_MODULE_2___default().each(collection, (_data, dataKey) => {
|
|
1217
1218
|
if (isKeyMatch(collectionKey, dataKey)) {
|
|
1218
1219
|
return;
|
|
1219
1220
|
}
|
|
1220
1221
|
|
|
1221
|
-
|
|
1222
|
+
if (true) {
|
|
1223
|
+
throw new Error(`Provided collection doesn't have all its data belonging to the same parent. CollectionKey: ${collectionKey}, DataKey: ${dataKey}`);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
hasCollectionKeyCheckFailed = true;
|
|
1227
|
+
_Logger__WEBPACK_IMPORTED_MODULE_6__.logAlert(`Provided collection doesn't have all its data belonging to the same parent. CollectionKey: ${collectionKey}, DataKey: ${dataKey}`);
|
|
1222
1228
|
});
|
|
1223
1229
|
|
|
1230
|
+
// Gracefully handle bad mergeCollection updates so it doesn't block the merge queue
|
|
1231
|
+
if (hasCollectionKeyCheckFailed) {
|
|
1232
|
+
return Promise.resolve();
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1224
1235
|
return getAllKeys().
|
|
1225
1236
|
then((persistedKeys) => {
|
|
1226
1237
|
// Split to keys that exist in storage and keys that don't
|