diff --git a/lib/OnyxUtils.ts b/lib/OnyxUtils.ts index f7ae2d83a..0d86b0191 100644 --- a/lib/OnyxUtils.ts +++ b/lib/OnyxUtils.ts @@ -2,7 +2,6 @@ import {deepEqual} from 'fast-equals'; import lodashClone from 'lodash/clone'; import type {ValueOf} from 'type-fest'; -import lodashPick from 'lodash/pick'; import DevTools from './DevTools'; import * as Logger from './Logger'; import type Onyx from './Onyx'; @@ -1417,9 +1416,8 @@ function updateSnapshots(data: OnyxUpdate[], mergeFn: typeof Onyx.merge): Array< } const oldValue = updatedData[key] || {}; - const newValue = lodashPick(value, Object.keys(snapshotData[key])); - updatedData = {...updatedData, [key]: Object.assign(oldValue, newValue)}; + updatedData = {...updatedData, [key]: Object.assign(oldValue, value)}; }); // Skip the update if there's no data to be merged diff --git a/tests/unit/onyxTest.ts b/tests/unit/onyxTest.ts index dda151511..9c5972819 100644 --- a/tests/unit/onyxTest.ts +++ b/tests/unit/onyxTest.ts @@ -1448,7 +1448,7 @@ describe('Onyx', () => { const snapshot1 = `${ONYX_KEYS.COLLECTION.SNAPSHOT}1`; const initialValue = {name: 'Fluffy'}; - const finalValue = {name: 'Kitty'}; + const finalValue = {name: 'Kitty', nickName: 'Fitse'}; await Onyx.set(cat, initialValue); await Onyx.set(snapshot1, {data: {[cat]: initialValue}});