[WIP] Make OnyxUtils get functions synchronous#773
[WIP] Make OnyxUtils get functions synchronous#773fabioh8010 wants to merge 5 commits intoExpensify:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65788d4ff2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| } | ||
| } | ||
| const cachedKeys = OnyxUtils.getAllKeys(); |
There was a problem hiding this comment.
Load persisted key index before clearing storage
clear() now derives allKeys from OnyxUtils.getAllKeys(), which is cache-backed only. If the in-memory key index is incomplete (for example after the initializeWithDefaultKeyStates() fallback path when Storage.getAll() fails, or after out-of-band storage writes), those persisted keys never enter keysToBeClearedFromStorage, so Storage.removeItems(...) leaves stale data behind after a clear/sign-out. The previous implementation could repopulate keys from storage on demand, so this change introduces a data-retention regression.
Useful? React with 👍 / 👎.
Details
E/App PR: Expensify/App#88130
Related Issues
GH_LINK
Automated Tests
Manual Tests
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