Repository navigation
[No QA] Avoid building archived reports ID set in canEditFieldOfMoneyRequest chain - #94185
Conversation
|
@ZhenjaHorbach 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad8dcddc5a
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-06-23.10.41.19.movAndroid: mWeb Chrome2026-06-23.10.43.06.moviOS: HybridApp2026-06-23.10.41.19.moviOS: mWeb Safari2026-06-23.10.43.06.movMacOS: Chrome / Safari2026-06-23.10.09.59.mov |
…rchived-set-in-canEditFieldOfMoneyRequest
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 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.4.18-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR against the help site articles under This is a pure internal performance refactor with no user-facing impact:
None of the help site articles document this internal architecture (archived-report ID set construction, Onyx subscriptions, function signatures). There are no new features, settings, labels, buttons, or workflow changes that a user would see, so no help site article needs updating. No draft PR was created since there is nothing to document. @TMisiukiewicz, if you believe a help site update is warranted that I missed, let me know and I'll create the draft PR. |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.18-2 🚀
|
Explanation of Change
Removes the prebuilt
ArchivedReportsIDSetfromcanEditFieldOfMoneyRequest,isReportOutstanding, andgetOutstandingReportsForUser. These functions now accept the rawreportNameValuePairscollection (OnyxCollection) and do a direct per-reportisArchivedReport((reportNameValuePairs ?? allReportNameValuePair)?.[key])lookup instead of building/scanning a Set.getOutstandingReportsForUserno longer callsbuildArchivedReportsIDSet(which did an O(n)Object.entriesscan over every RNVP); the archived check is now an O(1) lookup per report it already iterates.Callers that fed the set via
useArchivedReportsIDSet()now pass the rawREPORT_NAME_VALUE_PAIRScollection from auseOnyxsubscription:selectionBuilders.ts+SearchWriteActionsProvider.tsx(Search write path),useSelectedTransactionsActions.ts(reused its existing subscription),ReportField.tsx, anduseOutstandingReports.ts.Behavior preserved:
set.has(key)is equivalent toisArchivedReport(collection[key])since the set was built from the same collection; the?? allReportNameValuePairfallback keeps unmigrated (action-file) callers working unchanged.Deleted the now-unused
isReportArchivedByIDhelper and its export; updated the corresponding unit test to pass an RNVP collection.Fixed Issues
$ #94192
PROPOSAL:
Tests
No tests needed, pure refactor
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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