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
Amount & Distance field do not load after returning online when commuter exclusion is enabled #103291
Version Number: 9.5.4-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#102258 Email or phone of affected tester (no customers):applausetester+ssndjois2jd1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Enable commuterExclusions beta.
Home address - East 45th Street, Los Angeles, CA, 90012, US
Company address - 123 South Figueroa Street, Los Angeles, CA 90012
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Root cause: That PR added !transaction?.isReusedRoute to shouldFetchRoute in src/hooks/useFetchRoute.ts:42-47. The guard also turns off the existing commuter-exclusion refetch. Under the home-and-office method, the confirm page hides Amount and Distance until a route response returns the commute decision. For a reused route picked offline, that fetch never runs after you reconnect.
Recommendation: roll forward. The fix is a few lines; the PR touches 42 files. Revert it if no fix lands quickly.
Only a route response supplies the preview. The new guard blocks both isCommuterExclusionPreviewStale (useFetchRoute.ts:41) and the confirm page's fetch (IOURequestStepConfirmation.tsx:629). isReusedRoute is cleared only when waypoints change, so the page stays pending.
Why online seems to work (inferred, not tested): the Map screen stays mounted under Reuse route and runs the same hook (IOURequestStepDistanceMap.tsx:123). Between the two merges in step 1, isReusedRoute is briefly unset and routes is empty. Online, a fetch slips through in that window. Offline, the hook exits early (useFetchRoute.ts:50), and nothing refetches after you reconnect.
Other PRs ruled out: I checked all 62 App PRs in the 9.5.4-0 checklist for distance, route, confirmation, and commuter files. The other matches were refactors or unrelated UI changes. None touch route fetching or the commuter preview. The commuter pending logic dates from early September; only this PR adds isReusedRoute.
Suggested fix
In src/hooks/useFetchRoute.ts, keep skipping routing for reused routes unless the home-and-office decision is missing:
consthasCommuterExclusionPreview=DistanceRequestUtils.hasCommuterExclusionPreviewForPolicy(transaction,policy);constisCommuterExclusionPreviewStale=!!homeAndOfficeExclusionPolicyID&&hasRoute&&!hasRouteError&&!hasCommuterExclusionPreview;// A reused route carries its distance, but under the home and office method only a route response carries the commute decisionconstisReusedRouteMissingCommuterExclusionPreview=!!homeAndOfficeExclusionPolicyID&&!hasRouteError&&!hasCommuterExclusionPreview;constshouldFetchRoute=isMapDistanceRequest&&(transaction?.isReusedRoute
? isReusedRouteMissingCommuterExclusionPreview
: isRouteAbsentWithoutErrors||haveValidatedWaypointsChanged||isCommuterExclusionPreviewStale)&&!isLoadingRoute&&Object.keys(validatedWaypoints).length>1;
This cannot loop. isLoadingRoute blocks repeat requests, a success sets the preview, and a failure sets a route error. Add a useFetchRoute unit test: a reused route in a home-and-office workspace, offline then online, should call getRoute.
Next steps:ShridharGoel, please fix this forward or revert the PR. Reply with @MelvinBot <your feedback> to refine this analysis.
Probably not. The fix merged on Oct 20 in Improvements and fixes in reuse routes feature and reached staging in 9.5.15-1. I couldn't confirm it in the app myself, so Applause should retest on 9.5.15-1 or later.
Details
The fix:useFetchRoute no longer skips every reused route. For a reused route, it now fetches when the commute preview is missing, so Amount and Distance can load after you go back online (src/hooks/useFetchRoute.ts:45). This is the fix proposed earlier in this issue. The PR also adds a unit test for this case.
Why I couldn't retest: my web test account doesn't have the commuterExclusions beta, so "Exclude commutes" doesn't show up. Saving a home address also asks for a magic code that I can't get.
Activity
applause-bot commentedon Oct 7, 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/ded00425e1b3232bc997f4ac9df53d1eee1230753417ed3d2f74a12a2f1c66f5
melvin-bot commentedon Oct 7, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #102258
github-actions commentedon Oct 7, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Oct 7, 2026
@Gonals @Pujan92 you have been assigned to this deploy blocker because you reviewed the offending PR: #102258
melvin-bot commentedon Oct 7, 2026
@ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #102258
melvin-bot commentedon Oct 7, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Oct 7, 2026
Deploy Blocker Investigation
Causing PR: [Payment due @Pujan92] Add Reuse route to the distance creation flow (high confidence). This is a frontend bug, so it stays a
DeployBlockerCash.Root cause: That PR added
!transaction?.isReusedRoutetoshouldFetchRoutein src/hooks/useFetchRoute.ts:42-47. The guard also turns off the existing commuter-exclusion refetch. Under the home-and-office method, the confirm page hides Amount and Distance until a route response returns the commute decision. For a reused route picked offline, that fetch never runs after you reconnect.Recommendation: roll forward. The fix is a few lines; the PR touches 42 files. Revert it if no fix lands quickly.
How it breaks
selectReusableRoute(ReusableDistanceRoutes.ts:47-56) callsupdateWaypoints. That clearsroutesandcommuterExclusionPreview(Transaction.ts:467-496). It then setsisReusedRoute: trueand the storedquantity.isCommuterExclusionPreviewPending(useDistanceRequestState.ts:119-127) is true: workspace chat, home-and-office method, route present (viaquantity), and no preview. So Amount is blanked (useConfirmationAmount.ts:88-89) and the waypoints stay pending (DistanceRequestController.tsx:244-249).isCommuterExclusionPreviewStale(useFetchRoute.ts:41) and the confirm page's fetch (IOURequestStepConfirmation.tsx:629).isReusedRouteis cleared only when waypoints change, so the page stays pending.Why online seems to work (inferred, not tested): the Map screen stays mounted under Reuse route and runs the same hook (IOURequestStepDistanceMap.tsx:123). Between the two merges in step 1,
isReusedRouteis briefly unset androutesis empty. Online, a fetch slips through in that window. Offline, the hook exits early (useFetchRoute.ts:50), and nothing refetches after you reconnect.Other PRs ruled out: I checked all 62 App PRs in the 9.5.4-0 checklist for distance, route, confirmation, and commuter files. The other matches were refactors or unrelated UI changes. None touch route fetching or the commuter preview. The commuter pending logic dates from early September; only this PR adds
isReusedRoute.Suggested fix
In
src/hooks/useFetchRoute.ts, keep skipping routing for reused routes unless the home-and-office decision is missing:This cannot loop.
isLoadingRouteblocks repeat requests, a success sets the preview, and a failure sets a route error. Add auseFetchRouteunit test: a reused route in a home-and-office workspace, offline then online, should callgetRoute.Next steps:
ShridharGoel, please fix this forward or revert the PR. Reply with@MelvinBot <your feedback>to refine this analysis.3 remaining items
melvin-bot commentedon Oct 12, 2026
@Pujan92, @Gonals, @ShridharGoel Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Oct 14, 2026
@Pujan92, @Gonals, @ShridharGoel Still overdue 6 days?! Let's take care of this!
Gonals commentedon Oct 15, 2026
@ShridharGoel, are you working on this?
melvin-bot commentedon Oct 20, 2026
@Pujan92, @Gonals, @ShridharGoel Huh... This is 4 days overdue. Who can take care of this?
Gonals commentedon Oct 21, 2026
@MelvinBot, is this still a bug?
ShridharGoel commentedon Oct 21, 2026
Asking for a retest
MelvinBot commentedon Oct 21, 2026
Probably not. The fix merged on Oct 20 in Improvements and fixes in reuse routes feature and reached staging in 9.5.15-1. I couldn't confirm it in the app myself, so Applause should retest on 9.5.15-1 or later.
Details
useFetchRouteno longer skips every reused route. For a reused route, it now fetches when the commute preview is missing, so Amount and Distance can load after you go back online (src/hooks/useFetchRoute.ts:45). This is the fix proposed earlier in this issue. The PR also adds a unit test for this case.commuterExclusionsbeta, so "Exclude commutes" doesn't show up. Saving a home address also asks for a magic code that I can't get.view run · view recording
m-natarajan commentedon Oct 21, 2026
Distance and Amount load after going back online, Windows 11 Chrome, Google Pixel 7a / Android 17, iPhone 15 Pro / iOS 27.0.1, v9.5.15-2
Expensify_103291_iOS.mp4
Expensify_103291_Android.mp4
Expensify_103291_Web.mp4