Duplicate GPS distance expenses as manual distance - #98189
Conversation
|
@marufsharifi 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@x-dev90, could you please check the failed actions. thanks. |
Hi @marufsharifi, all actions have now passed successfully. Could you please review them again when you have a chance? Thank you. |
garrettmknight
left a comment
There was a problem hiding this comment.
Looks good from a product perspective.
|
@MelvinBot Review. |
Review: LGTM ✅The change correctly fixes the unexpected error when duplicating a GPS distance expense. A saved GPS transaction only keeps the derived waypoints/distance, not the raw GPS coordinate trace (that lives in a transient I traced the logic and found no correctness or regression issues: Correctness / regression analysis
Minor (non-blocking) note: because the waypoints are stripped, the duplicated expense loses the original start/end addresses and shows only the distance/amount (as any manual distance expense does). This satisfies the issue's expected result ("must not show unexpected error") and the merchant field is preserved separately, so it's fine — just calling out the intentional UX trade-off in case you want to confirm it's acceptable. Tests: Good coverage — 3 new tests exercise the workspace, self-DM, and report duplicate paths for GPS, plus the existing "map distance preserves waypoints" test guards the non-GPS path against regression. All CI is green (tests, typecheck, ESLint, Oxfmt, React Compiler). The only failing check is the Reviewer Checklist, which just needs to be filled out. Note on manual verificationI couldn't reproduce the flow end-to-end myself: GPS distance expenses can only be created via native GPS tracking on mobile (not web), and my web regression session hit an unrelated infra hiccup. The unit tests + green CI cover the behavior, but it's worth confirming the on-device flow (create GPS expense on Android → duplicate → open) matches the author's recording before approving. |
|
@marufsharifi , gentle bump. Thanks! |
|
@marufsharifi, quick bump—thanks! |
|
@x-dev90, could you please, merge the main. thanks. |
|
@marufsharifi ,I’ve addressed all your feedback. Could you please review the latest changes? thanks! |
|
@x-dev90, could you please merge the main. thanks. |
@marufsharifi, Done. |
|
Hi @marufsharifi , I’ve addressed all feedback on the PR. Could you please review the latest changes? thanks |
|
🚧 blimpich 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/blimpich in version: 9.4.74-0 🚀
|
|
🤖 Yes — help site changes were required. Draft PR: #100630 This PR changes user-visible behavior that neither help article described: duplicating a GPS distance expense that is not on a report (Unreported), or when the member has no workspace, now produces a manual distance expense. The copy keeps the saved total distance, but the route map and its start/end waypoints are dropped, because the raw GPS trace isn't stored on the saved transaction. A GPS distance expense already on a workspace report still duplicates as GPS with the route intact. Articles updated:
How I verified the behavior and the copyBehavior, from the diff in
UI labels were checked against the live web app before writing: Spend / Expenses nav tabs, More button, Duplicate expense menu item, Track distance in the Create menu, and the Map / Manual / GPS / Odometer tabs on the Track distance screen. All matched the existing articles' capitalization. Written against One thing I left out of scope: @x-dev90, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.74-2 🚀
|
Explanation of Change
GPS distance expenses are now duplicated as manual distance expenses because the saved transaction no longer contains the original GPS coordinate trace.
The duplicate flow now maps
DISTANCE_GPStoDISTANCE_MANUAL, skips copied GPS endpoint waypoints, keeps the saved measured distance, and uses the duplicated request type consistently for both workspace and self-DM duplicates.Added tests for GPS distance duplication in both workspace and self-DM flows, plus coverage to confirm normal map distance duplicates still preserve waypoints.
Fixed Issues
$#91814
PROPOSAL:#91814 (comment)
Tests
Offline tests
N/A
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
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.Screenshots/Videos
Android: Native
Screenrecorder-2026-08-10-23-42-52-914.mp4
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-08-28.at.11.21.57.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-08-28.at.11.24.10.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-28.at.11.26.31.AM.mov