Fix - Pay with BA-User is navigated to the Inbox instead of report after exiting "Add BA" modal #95822
Fix - Pay with BA-User is navigated to the Inbox instead of report after exiting "Add BA" modal #95822jmusial wants to merge 9 commits into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bae18e487a
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfd639fd5e
ℹ️ 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".
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.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 704cae834a
ℹ️ 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".
| source={CONST.KYC_WALL_SOURCE.REPORT} | ||
| chatReportID={chatReportID} | ||
| addBankAccountRoute={isExpenseReport ? ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: iouReport?.policyID, backTo: Navigation.getActiveRoute()}) : undefined} | ||
| addBankAccountRoute={isExpenseReport ? () => ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: iouReport?.policyID, backTo: Navigation.getActiveRoute()}) : undefined} |
There was a problem hiding this comment.
Resolve backTo instead of timing hydration
When the expense report route is still represented as an unresolved nested navigation intent (the case this change is trying to handle), this callback still asks Navigation.getActiveRoute() to serialize that same unhydrated state, so a fast tap or slow navigation hydration can still encode the malformed /?params=[object Object] value into backTo and send the bank-account Back flow to Inbox. Please derive backTo from a resolved report/search route or fix getPathFromState before building this route rather than relying on hydration finishing before the press.
Useful? React with 👍 / 👎.
Explanation of Change
When a nested navigator hasn't been hydrated yet, React Navigation stores the navigation intent verbatim as
NavigatorScreenParams({screen, params, path}) on the route, and its default serializer turns that into a malformed URL like/?params=[object Object], which then poisonsbackTovalues and sends users to the Inbox on back navigation.getPathFromStatenow detects this unresolved hint chain on the focused route and returns the real target URL embedded in params.path instead of falling through to React Navigation's serializer.Fixed Issues
$ #96153
PROPOSAL:
Tests
Offline tests
Same as tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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
iOS: Native
Screen.Recording.2026-07-21.at.11.32.13.mov