Repository navigation
Conversation
Under SearchScopeProvider, useOnyx can serve snapshot copies of collections, which breaks the reference-equality diff (every member reports as changed and live members missing from the snapshot report as removed). Throw in dev so a consumer mounted under Search is caught in development and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@bernhardoj Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.41-0 🚀
|
|
No help site update needed — this PR adds only a development-only guard and unit tests, with no change to production behavior or user-facing workflows. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.41-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
useCollectionDeltadiffs a collection against its previous render by member reference. That only works on live Onyx data, where unchanged members keep their reference. UnderSearchScopeProvider, the AppuseOnyxcan redirectreport_,policy_,transactions_,transactionViolations_andreportNameValuePairs_reads to asnapshot_<hash>copy; a switch between live and snapshot data would report every member as changed and live members missing from the snapshot as removed.Nothing hits this today: the only consumer,
SidebarOrderedReportsContextProvider, is mounted inAuthScreensabove everySearchScopeProvider. This PR makes that assumption enforced instead of implicit: the hook throws in__DEV__when rendered under Search scope, so a future consumer mounted there is caught in development and Jest. Production behavior is unchanged.Fixed Issues
$ #107165
PROPOSAL:
Tests
npx jest tests/unit/useCollectionDeltaTest.tsx: the new "should throw when rendered under Search scope" case fails without the guard and passes with it; theisOnSearch={false}case stays silent.Offline tests
N/A, no network behavior change.
QA Steps
None, dev-only guard ([No QA]).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
🤖 Generated with Claude Code