react-native-onyx 1.0.32 → 1.0.33

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/lib/Onyx.js CHANGED
@@ -799,8 +799,7 @@ function notifyCollectionSubscribersOnNextTick(key, value) {
799
799
  * @return {Promise}
800
800
  */
801
801
  function remove(key) {
802
- // Cache the fact that the value was removed
803
- cache.set(key, null);
802
+ cache.drop(key);
804
803
  notifySubscribersOnNextTick(key, null);
805
804
  return Storage.removeItem(key);
806
805
  }
@@ -847,8 +846,9 @@ function evictStorageAndRetry(error, onyxMethod, ...args) {
847
846
  * @returns {Promise}
848
847
  */
849
848
  function set(key, value) {
850
- // Logging properties only since values could be sensitive things we don't want to log
851
- Logger.logInfo(`set() called for key: ${key}${_.isObject(value) ? ` properties: ${_.keys(value).join(',')}` : ''}`);
849
+ if (_.isNull(value)) {
850
+ return remove(key);
851
+ }
852
852
 
853
853
  // eslint-disable-next-line no-use-before-define
854
854
  if (hasPendingMergeForKey(key)) {
@@ -1294,6 +1294,7 @@ const Onyx = {
1294
1294
  mergeCollection,
1295
1295
  update,
1296
1296
  clear,
1297
+ getAllKeys,
1297
1298
  init,
1298
1299
  registerLogger: Logger.registerLogger,
1299
1300
  addToEvictionBlockList,
package/lib/OnyxCache.js CHANGED
@@ -104,6 +104,8 @@ class OnyxCache {
104
104
  */
105
105
  drop(key) {
106
106
  delete this.storageMap[key];
107
+ this.storageKeys.delete(key);
108
+ this.recentKeys.delete(key);
107
109
  }
108
110
 
109
111
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",