Skip to content

[Due for payment 2026-10-23] [$175] Hybrid - After close and reopen app the distance edit page is dismissed #103041

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.1-9
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/76795563/folder/57599982/41237151/1820739485?sort=%2Bidentifier
Email or phone of affected tester (no customers): leungbratt6+0410@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Pixel 7 Pro/Android 17
App Component: Chat Report View

Action Performed:

  1. Open the hybrid app
  2. Go to Workspace chat as a member of a Workspace
  3. Submit a distance expense
  4. Go to the transaction thread of the expense created
  5. Click Distance
  6. Add another waypoint
  7. Refresh the page while the distance editor RHP is open (NOTE: close and reopen the app on Android and iOS)
  8. Verify that the waypoint is restored to the original value and the unsaved waypoint change (the waypoint added in step (5) is reverted)

Expected Result:

  1. Verify that the waypoint is restored to the original value and the unsaved waypoint change (the waypoint added in step (5) is reverted)

Actual Result:

The distance edit page is dismissed after closing and reopening the hybrid app

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

To be added by Applause Leads

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7276836

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 5, 2026
  2. applause-bot commented on Oct 5, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/440e06b0334ad4ac843359480326d5f405838f035647b81ee5097d14b6a5b30c

  3. MelvinBot commented on Oct 5, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On HybridApp (Android/iOS), if you kill and reopen the app while the distance editor is open, the editor closes. It should stay open, with the original waypoints restored.

    What is the root cause of that problem?

    On a native cold start there is no URL, so the app reopens the last screen by restoring lastVisitedPath in NavigationRoot.tsx:175-185.

    An earlier check in NavigationRoot.tsx:163-165 returns early when account.isFromPublicDomain is true. The tester uses a gmail.com account, so the restore never runs and the app opens on the default tab.

    This check was added for an onboarding redirect in Dismissing onboarding fix. Create Navigation guards with OnboardingGuard & TestDriveModalGuard moved that redirect to OnboardingGuard, but left the check behind. Now the check only blocks the restore. Web is not affected because a refresh rebuilds the page from the browser URL.

    What changes do you think we should make in order to solve the problem?

    1. Remove the account.isFromPublicDomain condition from the early return in NavigationRoot's initialState. If nothing else uses account there, remove the whole block and the ACCOUNT subscription. The existing authenticated, transition-URL, and deep-link checks already handle the safety cases.
    2. Add a unit test. It should use a public-domain account, no initial URL, and a saved RHP path, and check that the saved path is restored.

    Once the page is restored, the existing backup logic reverts the unsaved waypoint, so no change to the distance step is needed.

    What alternative solutions did you explore? (Optional)

    If product wants native to always open on Home (see the closed issue Mobile app reopens the last-used screen after the app is killed instead of starting at Home), the native part of this test case should be updated instead.

    Supporting evidence
    • HybridApp overrides getInitialURL, which returns no deep link on a cold launch: setup/hybridApp/index.native.ts:10.
    • isFromPublicDomain means the account uses a public email domain: types/onyx/Account.ts:195-196.
    • The distance edit route is saved to lastVisitedPath and is not in EXCLUDE_FROM_LAST_VISITED_PATH: CONST/runtimeConfigured.ts:69-81.
    • The distance step does not dismiss itself. When it mounts, createBackupTransaction writes the saved backup back over the transaction, which gives the expected revert: TransactionEdit.ts:41-55.
    • Navigate to expense detail page after adding a receipt turned on the restore for HybridApp in October 2025. Gmail accounts have been excluded the whole time, so this is a long-standing bug, not a new regression. It also reproduces in production.
    • Not verified: that isFromPublicDomain is true for this exact account. It should be true for gmail.com.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/103041) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 5, 2026
  5. melvin-bot commented on Oct 5, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (External)

  6. changed the title [-]Hybrid - After close and reopen app the distance edit page is dismissed[/-] [+][$175] Hybrid - After close and reopen app the distance edit page is dismissed[/+] on Oct 5, 2026
  7. melvin-bot commented on Oct 5, 2026

    @melvin-bot
  8. camesenin commented on Oct 5, 2026

    @camesenin
  9. melvin-bot commented on Oct 5, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  10. huult commented on Oct 6, 2026

    @huult
    Contributor

    @Expensify/product I’m not sure if this is actually a bug because this is a public domain (Gmail, Yahoo, etc.), so we may not be able to restore the lastVisitedPath.

    That’s why I’d like to ask the Product team to confirm whether lastVisitedPath should not be restored for public domains. If so, this would not be a bug.

    Thanks!

  11. trjExpensify commented on Oct 6, 2026

    @trjExpensify
    Contributor

    That's news to me. From a product perspective, I don't think the distance expense feature should work differently depending on your login. @mountiny might have an idea on the history of this lastVisitedPath thing. 👍

  12. mountiny commented on Oct 7, 2026

    @mountiny
    Contributor

    I agree with Tom. I don't think that the feature should work differently based on the domain. Can you maybe look at the blame to see if there is more context in the PR which implemented this?

  13. 21 remaining items

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 17, 2026
  15. melvin-bot commented on Oct 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Oct 22, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. mallenexpensify commented on Oct 26, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @huult due $175 via NewDot

  18. JmillsExpensify commented on Nov 14, 2026

    @JmillsExpensify
    Contributor

    $175 approved for @huult

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions