Closed
Conversation
s77rt
commented
Apr 21, 2024
Comment on lines
+186
to
+194
| const finalObjectCache = { | ||
| a: 'a', | ||
| b: null, | ||
| c: 'c', | ||
| }; | ||
| const finalObject = { | ||
| a: 'a', | ||
| c: 'c', | ||
| }; |
Member
Author
There was a problem hiding this comment.
The cache having null values in intended #411
1 task
Contributor
|
@s77rt this is already being fixed here: https://github.com/Expensify/react-native-onyx/pull/519/files |
Member
Author
|
Closing in favor of #519 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@neil-marcellini @chrispader from #437
@marc from Expensify/App#34692
Details
On the above linked PR we made the
prepareKeyValuePairsForStoragefunction remove null values. Removing the null values is only needed for SET operations so we don't have redundant keys e.g.{reportID: 123, nonUsedProp: null, anotherNonUserProp: null}. For MERGE however we need to keep those null values (at the top level) so the provider knows that we want to clear them (at a lower level).Related Issues
Expensify/App#34692
This is coming from Expensify/App#40254 (comment)
Automated Tests
Added a test to verify that nulled key-values on
mergeCollectionare removed correctly.Manual Tests
Not needed.
mergeCollectionis hardly used on /App. It's only used for tests, migrations and stories.Author Checklist
### Related Issuessection aboveTestssectiontoggleReportand notonIconClick)myBool && <MyComponent />.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Avataris modified, I verified thatAvataris working as expected in all cases)mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop