Remove Onyx.connect() for the key: ONYXKEYS.COLLECTION.REPORT in src/libs/ReportUtils.ts (part 5) - #93267
Conversation
|
@DylanDylann 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: 8f8c69c8a5
ℹ️ 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 adminsChatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${adminsChatReportID}`]; | ||
| const conciergeChat = | ||
| getChatByParticipants([CONST.ACCOUNT_ID.CONCIERGE, deprecatedCurrentUserAccountID ?? CONST.DEFAULT_NUMBER_ID], deprecatedAllReports, false) ?? | ||
| getChatByParticipants([CONST.ACCOUNT_ID.CONCIERGE, deprecatedCurrentUserAccountID ?? CONST.DEFAULT_NUMBER_ID], reports, false) ?? |
There was a problem hiding this comment.
Keep onboarding report lookups on one snapshot
When a caller supplies reports, the target chat is now resolved from that passed snapshot, but later rollback/self-DM logic in this same function still reads deprecatedAllReports (for example when restoring the previous last visible action and when checking for an existing self-DM). If the React-provided collection is newer than the module-level cache during onboarding, an API failure can roll back stale preview state or miss an existing self-DM. Please use the same reports collection for the remaining report lookups in this flow before switching callers over to it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@truph01 Could we avoid passing the entire report collection into the prepareOnboardingOnyxData function? Instead, we can pass the concierge report (using conciergeReportID from Onyx to subscribe to just one report) rather than using getChatByParticipants. For the other instances of report params, I believe we can handle them similarly by passing only the specific reports we need.
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.
|
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
|
@truph01 the 4th PR is merged. Could you merge the latest main? |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
| /** The concierge chat report, looked up by conciergeReportID. Falls back to getChatByParticipants using the deprecated module-level Onyx data while the refactor is in progress. */ | ||
| conciergeChat?: OnyxEntry<Report>; | ||
| /** The admins chat report, looked up by adminsChatReportID. Falls back to the deprecated module-level Onyx data while the refactor is in progress. */ | ||
| adminsChatReport?: OnyxEntry<Report>; |
There was a problem hiding this comment.
A boolean flag should be enough. I’d prefer to avoid passing a large object unnecessarily.
There was a problem hiding this comment.
I believe we can use a selector here
There was a problem hiding this comment.
A boolean flag should be enough. I’d prefer to avoid passing a large object unnecessarily.
@DylanDylann What do you mean by using "boolean flag" here?
There was a problem hiding this comment.
My bad, let's ignore this
|
@truph01 We don't always need to pass all three new params in every case. Please check the onboardingChoices value to determine exactly which parameter is necessary |
|
@codex review @MelvinBot review |
ReviewLooks solid — the refactor is correct and safe. Each call site now passes only the report(s) its engagement choice actually consumes, and every new param falls back to the deprecated module-level lookup ( Call-site param mapping (all correct)
Against that:
1. 2. 3. Minor: Tests covering the new param paths look good. 👍 |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@truph01 I don't think we need comments here since it's already obvious. |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-06-25.at.18.39.40.mov |
DylanDylann
left a comment
There was a problem hiding this comment.
Some NITs ☝️ The rest looks fine to me
Co-authored-by: DylanDylann <141406735+DylanDylann@users.noreply.github.com>
…dFeatures.tsx Co-authored-by: DylanDylann <141406735+DylanDylann@users.noreply.github.com>
Co-authored-by: DylanDylann <141406735+DylanDylann@users.noreply.github.com>
Co-authored-by: DylanDylann <141406735+DylanDylann@users.noreply.github.com>
…ils.tsx Co-authored-by: DylanDylann <141406735+DylanDylann@users.noreply.github.com>
Co-authored-by: DylanDylann <141406735+DylanDylann@users.noreply.github.com>
|
🚧 Gonals 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/Gonals in version: 9.4.25-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.4.25-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
This PR focus on refactoring the following flow:
Fixed Issues
$ #66416
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Screen.Recording.2026-06-11.at.17.44.00.mov