Fix: return to Agents list when tapping back on a newly created agent DM - #97868
Conversation
… DM (narrow) Co-authored-by: Michał Jasikowski <mjasikowski@users.noreply.github.com>
|
🚧 mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
@MelvinBot back to agent list works fine, but tapping the newly created agent row redirects to "hmm it's not here" page after a second or two |
Issue AnalysisRoot cause: The newly-created agent row is keyed on a throwaway optimistic This is separate from and pre-existing relative to this PR — the diff here only touches The chain:
The "after a second or two" timing is exactly the Recommended fix (a design choice for you):
Since this is a distinct, pre-existing bug rather than a regression from this PR's change, I'd suggest fixing it separately (or explicitly folding it in) rather than silently expanding this PR's scope. Next Steps: Reply with |
|
@MelvinBot implement your latest suggestion (the full version) in a separate PR |
|
@MelvinBot also remove this comment from the current PR: |
|
I dug in to build the full version and hit a wall — it can't be done in the App repo alone, so I haven't opened a PR. Correcting my earlier suggestion: the "reconcile optimistic → real accountID and redirect the open page" approach isn't actually possible client-side, because the client is never told the real accountID that replaces the optimistic one. Why the full (redirect) fix needs the backend:
The correct root-cause fix is a backend change (Auth / Web-Expensify): have What I can ship in App (a mitigation, not the full fix): guard How do you want to proceed?
|
Co-authored-by: Michał Jasikowski <mjasikowski@users.noreply.github.com>
|
Done — removed the two-line |
|
🤖 No code-related checks are failing — nothing to push. When this was reported, several checks ( The only remaining red mark is No fix was needed or pushed. |
|
@eVoloshchak 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] |
garrettmknight
left a comment
There was a problem hiding this comment.
Looks good from a product perspective.
|
|
|
@eVoloshchak can you review this please? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppscreen-20260826-143748-1787747834755.mp4Android: mWeb ChromeScreen.Recording.2026-08-26.at.09.00.45.moviOS: HybridAppScreen.Recording.2026-08-26.at.08.49.46.moviOS: mWeb SafariScreen.Recording.2026-08-26.at.08.50.28.movMacOS: Chrome / SafariScreen.Recording.2026-08-25.at.20.12.27.mov |
|
🚧 mjasikowski 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/mjasikowski in version: 9.4.63-0 🚀
|
|
🤖 No help site changes required. This PR is an internal navigation bug fix, not a user-facing behavior or feature change, so no updates to Why no docs change is neededThe change adds a The relevant help article, Create and Use Agents, documents how to create, chat with, Copilot into, and manage agents. It does not document the low-level back-button navigation this PR corrects, and the documented create flow ("After saving, the new agent appears in your Agents list") remains accurate. Nothing in that article — or any other article under @mjasikowski, no linked help site PR was created since the change doesn't affect any documented behavior. Let me know if you'd like a docs PR opened anyway. |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.63-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
On narrow (native) layouts, creating an agent revealed the new DM as a fullscreen report and then dismissed the entire Settings → Agents → New agent modal stack (
revealRouteBeforeDismissingModal). That left the Agents list off the back stack, so tapping back on the agent chat fell through to the LHN instead of returning to Agents.This passes a
backToparam pointing at the Agents list (ROUTES.SETTINGS_AGENTS) when revealing the DM, so the report header's back button (ReportHeader.onBackButtonPress→Navigation.goBack(backTo)) returns to the Agents list as expected.Wide layouts are unchanged: they already open the DM inside the RHP (
AGENT_REPORTwithforceReplace) and correctly return to Agents. Only the narrow-layout branch is affected. Follow-up to #95631.Fixed Issues
$ #97832
PROPOSAL:
Tests
On a narrow layout or mobile native:
Offline tests
Same as tests — the agent create + navigation flow is fully optimistic and works online or offline.
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.See checklist for screenshots