You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-10-23] [$175] Hybrid - After close and reopen app the distance edit page is dismissed #103041
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.
What changes do you think we should make in order to solve the problem?
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.
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)
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.
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
@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.
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. 👍
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?
Activity
applause-bot commentedon Oct 5, 2026
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
MelvinBot commentedon Oct 5, 2026
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
lastVisitedPathinNavigationRoot.tsx:175-185.An earlier check in
NavigationRoot.tsx:163-165returns early whenaccount.isFromPublicDomainis 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?
account.isFromPublicDomaincondition from the early return inNavigationRoot'sinitialState. If nothing else usesaccountthere, remove the whole block and theACCOUNTsubscription. The existingauthenticated, transition-URL, and deep-link checks already handle the safety cases.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
getInitialURL, which returns no deep link on a cold launch:setup/hybridApp/index.native.ts:10.isFromPublicDomainmeans the account uses a public email domain:types/onyx/Account.ts:195-196.lastVisitedPathand is not inEXCLUDE_FROM_LAST_VISITED_PATH:CONST/runtimeConfigured.ts:69-81.createBackupTransactionwrites the saved backup back over the transaction, which gives the expected revert:TransactionEdit.ts:41-55.isFromPublicDomainistruefor 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
melvin-bot commentedon Oct 5, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (
External)[-]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[/+]melvin-bot commentedon Oct 5, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022107110244458377611
camesenin commentedon Oct 5, 2026
melvin-bot commentedon Oct 5, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
huult commentedon Oct 6, 2026
@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
lastVisitedPathshould not be restored for public domains. If so, this would not be a bug.Thanks!
trjExpensify commentedon Oct 6, 2026
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
lastVisitedPaththing. 👍mountiny commentedon Oct 7, 2026
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?
21 remaining items
melvin-bot commentedon Oct 22, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 22, 2026
Payment Summary
Resolving PRs:
Restore last visited page on cold start for public domain accounts #103818
Reviewer: @huult owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 26, 2026
Payment Summary
Contributor+: @huult due $175 via NewDot
JmillsExpensify commentedon Nov 14, 2026
$175 approved for @huult