react-native-onyx 2.0.105 → 2.0.107

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.
Files changed (2) hide show
  1. package/dist/Onyx.js +5 -0
  2. package/package.json +2 -2
package/dist/Onyx.js CHANGED
@@ -208,6 +208,11 @@ function multiSet(data) {
208
208
  const keyValuePairsToSet = OnyxUtils_1.default.prepareKeyValuePairsForStorage(newData, true);
209
209
  const updatePromises = keyValuePairsToSet.map(([key, value]) => {
210
210
  const prevValue = OnyxCache_1.default.get(key, false);
211
+ // When we use multiSet to set a key we want to clear the current delta changes from Onyx.merge that were queued
212
+ // before the value was set. If Onyx.merge is currently reading the old value from storage, it will then not apply the changes.
213
+ if (OnyxUtils_1.default.hasPendingMergeForKey(key)) {
214
+ delete OnyxUtils_1.default.getMergeQueue()[key];
215
+ }
211
216
  // Update cache and optimistically inform subscribers on the next tick
212
217
  OnyxCache_1.default.set(key, value);
213
218
  return OnyxUtils_1.default.scheduleSubscriberUpdate(key, value, prevValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "2.0.105",
3
+ "version": "2.0.107",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",
@@ -126,7 +126,7 @@
126
126
  }
127
127
  },
128
128
  "engines": {
129
- "node": ">=20.18.1",
129
+ "node": ">=20.19.1",
130
130
  "npm": ">=10.8.2"
131
131
  },
132
132
  "sideEffects": false