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-02-19] Distance - Map is missing green line when splitting distance expense, confirm page is empty #80714
Or we can pass newIouType here as distance-map if the newIouType is distance
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Restate the problem this issue is trying to solve.
When a distance expense is split, the map step does not show the green route line and the confirm step shows the distance as Pending with empty amounts. The route data from the original distance request is not available in the split transaction, so the UI cannot show the route or calculate the distance.
What is the root cause of that problem?
The earliest wrong assumption is that route data will still be available after creating a split transaction. In src/libs/actions/IOU/index.ts, function createSplitsAndOnyxData, the code assumes fastMerge(existingTransaction, splitTransaction, false) will keep the route data from the draft transaction, but it does not. The split transaction is saved in the CURRENT state, while the route was fetched and stored on the DRAFT transaction, so the split transaction ends up without routes and later code cannot find them.
What changes do you think we should make in order to solve the problem?
Preserve route data when creating split distance transactions.
File: src/libs/actions/IOU/index.ts
Location: after the merge in createSplitsAndOnyxData
// File: src/libs/actions/IOU/index.ts (after line 6598)// Important data is set on the draft distance transaction, such as the iouRequestType marking it as a distance request, so merge it into the optimistic split transactionif(isDistanceRequest){splitTransaction=fastMerge(existingTransaction,splitTransaction,false);// Ensure route data is preserved when creating split transactionif(existingTransaction?.routes){splitTransaction.routes=existingTransaction.routes;}}
Fetch routes from the correct transaction state for split transactions.
What alternative solutions did you explore? (Optional)
Always refetch the route for split transactions. This was not chosen because the route already exists and refetching adds extra network work and delay.
🚨 Edited by proposal-police: This proposal was edited at 2026-01-28 08:22:54 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When splitting a distance expense, the distance map step does not draw the route line, and the confirmation step shows an empty split/total with “Pending” for distance, even after entering valid start/stop waypoints.
What is the root cause of that problem?
In the split distance flow, the draft transaction is initialized with the generic request type (iouRequestType: distance) rather than a map-specific type.
The route fetcher only triggers when isMapDistanceRequest is true (which maps to iouRequestType: distance-map before save or a distance custom unit after save). Because the split draft does not satisfy that check, the hook never calls getRoute(), so transaction.routes.route0.geometry.coordinates remains empty. With no coordinates, the map cannot draw the green line and the confirmation step has no route data to derive split totals.
Flow-wise, this is what happens in the split distance path:
The split flow initializes a draft transaction for the distance expense with the generic type (iouRequestType: distance) rather than the map-specific type. This happens during the split distance creation in src/libs/actions/IOU/index.ts.
The distance map step and the confirmation step both rely on useFetchRoute (src/hooks/useFetchRoute.ts) to request a route when waypoints are valid.
useFetchRoute only fetches when isMapDistanceRequest(transaction) is true. isMapDistanceRequest (src/libs/TransactionUtils/index.ts) only returns true for iouRequestType: distance-map (pre‑save) or when the saved transaction has a distance custom unit.
Because the split draft is iouRequestType: distance, the route fetch never triggers, so no route is written into transaction.routes.route0.geometry.coordinates.
Without route coordinates, the map cannot draw the green line and the confirmation step has no distance/amount data to show (stays pending).
What changes do you think we should make in order to solve the problem?
Allow draft distance transactions that are still marked as the generic request type (iouRequestType: distance) to be treated as route-eligible in the fetch hook. The smallest change is in src/hooks/useFetchRoute.ts, expanding the shouldFetchRoute condition to include draft transactions with iouRequestType: distance.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.17-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Pujan92@heyjennahay The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jan 28, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)melvin-bot commentedon Jan 28, 2026
Triggered auto assignment to @heyjennahay (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.nkdengineer commentedon Jan 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Step 4, map is missing green line.
In Step 5, Confirm page does not show split and total amount and "Pending" as Distance.
What is the root cause of that problem?
isMapDistanceRequestis onlytrueif theiouRequestTypeisdistance-mapApp/src/hooks/useFetchRoute.ts
Lines 28 to 30 in 04bfa3e
For split distance,
iouRequestTypeisdistancethenshouldFetchRouteisfalseand the route isn't fetched which causes no green line in the mapWhat changes do you think we should make in order to solve the problem?
We should update
isMapDistanceRequestto also returntrueif theiouRequestTypeisdistance.App/src/hooks/useFetchRoute.ts
Lines 28 to 30 in 04bfa3e
What alternative solutions did you explore? (Optional)
We can change the tab name here to distance-map
App/src/pages/iou/request/IOURequestStartPage.tsx
Line 355 in 04bfa3e
Or we can pass newIouType here as
distance-mapif thenewIouTypeisdistanceReminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
yatin-italy commentedon Jan 28, 2026
Proposal
Restate the problem this issue is trying to solve.
When a distance expense is split, the map step does not show the green route line and the confirm step shows the distance as Pending with empty amounts. The route data from the original distance request is not available in the split transaction, so the UI cannot show the route or calculate the distance.
What is the root cause of that problem?
The earliest wrong assumption is that route data will still be available after creating a split transaction. In
src/libs/actions/IOU/index.ts, functioncreateSplitsAndOnyxData, the code assumesfastMerge(existingTransaction, splitTransaction, false)will keep the route data from the draft transaction, but it does not. The split transaction is saved in the CURRENT state, while the route was fetched and stored on the DRAFT transaction, so the split transaction ends up without routes and later code cannot find them.What changes do you think we should make in order to solve the problem?
Preserve route data when creating split distance transactions.
src/libs/actions/IOU/index.tscreateSplitsAndOnyxDataFetch routes from the correct transaction state for split transactions.
src/pages/iou/request/step/IOURequestStepDistanceMap.tsxUse the same correct transaction state on the confirmation step.
src/pages/iou/request/step/IOURequestStepConfirmation.tsxWhat alternative solutions did you explore? (Optional)
marufsharifi commentedon Jan 28, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-01-28 08:22:54 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When splitting a distance expense, the distance map step does not draw the route line, and the confirmation step shows an empty split/total with “Pending” for distance, even after entering valid start/stop waypoints.
What is the root cause of that problem?
In the split distance flow, the draft transaction is initialized with the generic request type (
iouRequestType: distance) rather than a map-specific type.The route fetcher only triggers when
isMapDistanceRequestis true (which maps toiouRequestType: distance-mapbefore save or a distance custom unit after save). Because the split draft does not satisfy that check, the hook never callsgetRoute(), sotransaction.routes.route0.geometry.coordinatesremains empty. With no coordinates, the map cannot draw the green line and the confirmation step has no route data to derive split totals.Flow-wise, this is what happens in the split distance path:
iouRequestType: distance) rather than the map-specific type. This happens during the split distance creation insrc/libs/actions/IOU/index.ts.App/src/libs/actions/IOU/index.ts
Lines 1182 to 1189 in 04bfa3e
useFetchRoute(src/hooks/useFetchRoute.ts) to request a route when waypoints are valid.useFetchRouteonly fetches whenisMapDistanceRequest(transaction)is true.isMapDistanceRequest(src/libs/TransactionUtils/index.ts) only returns true foriouRequestType: distance-map(pre‑save) or when the saved transaction has a distance custom unit.App/src/hooks/useFetchRoute.ts
Lines 14 to 33 in 04bfa3e
iouRequestType: distance, the route fetch never triggers, so no route is written intotransaction.routes.route0.geometry.coordinates.What changes do you think we should make in order to solve the problem?
Allow draft distance transactions that are still marked as the generic request type (
iouRequestType: distance) to be treated as route-eligible in the fetch hook. The smallest change is insrc/hooks/useFetchRoute.ts, expanding theshouldFetchRoutecondition to include draft transactions withiouRequestType: distance.Solution code .
Apply in
useFetchRoute.tshookWhat alternative solutions did you explore? (Optional)
Pujan92 commentedon Jan 28, 2026
@nkdengineer's proposal looks good here(I am more inclined towards alternative solution of using distance-map as an iouType).
🎀👀🎀 C+ reviewed
melvin-bot commentedon Jan 28, 2026
Triggered auto assignment to @robertjchen, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
14 remaining items
melvin-bot commentedon Feb 12, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.17-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-02-19. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 12, 2026
@Pujan92 @heyjennahay The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Feb 19, 2026
Payment Summary
Upwork Job
BugZero Checklist (@heyjennahay)
heyjennahay commentedon Feb 20, 2026
Hi @Pujan92 can you please complete the BugZero checklist so I can process the payment summary?
Pujan92 commentedon Feb 23, 2026
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/79914/changes#r2841347975
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/604680
Regression Test Proposal
Do we agree 👍 or 👎
heyjennahay commentedon Feb 26, 2026
Payment summary
Thanks everyone!
twisterdotcom commentedon Feb 27, 2026
@Pujan92 has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-67ab-a24a-adf8-be95e9146684