Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Onyx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
* @param key ONYXKEY to set
* @param value value to store
*/
function set<TKey extends OnyxKey>(key: TKey, value: OnyxSetInput<TKey>): Promise<void> {
function set<TKey extends OnyxKey>(key: TKey, value: OnyxSetInput<TKey>, options: {skipNullValuesCheck: boolean}): Promise<void> {
// When we use Onyx.set to set a key we want to clear the current delta changes from Onyx.merge that were queued
// before the value was set. If Onyx.merge is currently reading the old value from storage, it will then not apply the changes.
if (OnyxUtils.hasPendingMergeForKey(key)) {
Expand Down Expand Up @@ -171,7 +171,7 @@
}

// If the value is null, we remove the key from storage
const {value: valueAfterRemoving, wasRemoved} = OnyxUtils.removeNullValues(key, value);
const {value: valueAfterRemoving, wasRemoved} = OnyxUtils.removeNullValues(key, value, !options.skipNullValuesCheck);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this option being added to OnyxUtils.removeNullValues in the PR?

Copy link
Copy Markdown
Contributor Author

@kacper-mikolajczak kacper-mikolajczak Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrispader! This PR is going to be closed, as the implementation will be continued with more generalised approach in #620

@fabioh8010 is working on this and he will know more about upcoming implementation


const logSetCall = (hasChanged = true) => {
// Logging properties only since values could be sensitive things we don't want to log
Expand Down Expand Up @@ -199,7 +199,7 @@
}

return Storage.setItem(key, valueWithoutNullValues)
.catch((error) => OnyxUtils.evictStorageAndRetry(error, set, key, valueWithoutNullValues))

Check failure on line 202 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / perf-tests

Expected 5 arguments, but got 4.

Check failure on line 202 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / test

Expected 5 arguments, but got 4.

Check failure on line 202 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / lint

Expected 5 arguments, but got 4.

Check failure on line 202 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / lint

Expected 5 arguments, but got 4.
.then(() => {
OnyxUtils.sendActionToDevTools(OnyxUtils.METHOD.SET, key, valueWithoutNullValues);
return updatePromise;
Expand Down Expand Up @@ -745,7 +745,7 @@
const batchedChanges = OnyxUtils.applyMerge(undefined, operations, false);

if (operations[0] === null) {
promises.push(() => set(key, batchedChanges));

Check failure on line 748 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / perf-tests

Expected 3 arguments, but got 2.

Check failure on line 748 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / test

Expected 3 arguments, but got 2.

Check failure on line 748 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / lint

Expected 3 arguments, but got 2.

Check failure on line 748 in lib/Onyx.ts

View workflow job for this annotation

GitHub Actions / lint

Expected 3 arguments, but got 2.
} else {
promises.push(() => merge(key, batchedChanges));
}
Expand Down
Loading