Skip to content

Commit 8a881f4

Browse files
committed
Do not allow empty array coercion in setWithRetry
1 parent 6eec8b4 commit 8a881f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/OnyxUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,8 +1343,8 @@ function setWithRetry<TKey extends OnyxKey>({key, value, options}: SetParams<TKe
13431343
}
13441344

13451345
// Check if the value is compatible with the existing value in the storage
1346-
const {isCompatible, existingValueType, newValueType} = utils.checkCompatibilityWithExistingValue(value, existingValue);
1347-
if (!isCompatible) {
1346+
const {isCompatible, existingValueType, newValueType, isEmptyArrayCoercion} = utils.checkCompatibilityWithExistingValue(value, existingValue);
1347+
if (!isCompatible || isEmptyArrayCoercion) {
13481348
Logger.logAlert(logMessages.incompatibleUpdateAlert(key, 'set', existingValueType, newValueType));
13491349
return Promise.resolve();
13501350
}

0 commit comments

Comments
 (0)