From e50f029b3fe824812d14bfa25797a352afc8e60e Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 13 Jul 2023 09:43:29 -0600 Subject: [PATCH] throw in dev --- lib/Onyx.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Onyx.js b/lib/Onyx.js index 3486c20f3..381b4f286 100644 --- a/lib/Onyx.js +++ b/lib/Onyx.js @@ -1134,6 +1134,11 @@ function mergeCollection(collectionKey, collection) { if (isKeyMatch(collectionKey, dataKey)) { return; } + + if (process.env.NODE_ENV === 'development') { + throw new Error(`Provided collection doesn't have all its data belonging to the same parent. CollectionKey: ${collectionKey}, DataKey: ${dataKey}`); + } + hasCollectionKeyCheckFailed = true; Logger.logAlert(`Provided collection doesn't have all its data belonging to the same parent. CollectionKey: ${collectionKey}, DataKey: ${dataKey}`); });