[CP Staging] Show Resume/Save buttons when GPS tracking is stopped immediately#90237
Conversation
When a user starts GPS tracking and immediately stops before moving, stopGpsTrip was removing the only segment, leaving gpsPoints as []. This made isTripStopped return false, hiding the Resume/Save buttons. Now stopGpsTrip only removes the last segment when there are multiple segments, and isTripStopped checks segment count instead of point count. Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
The only completed failing check is checklist (PR Author Checklist), which is a manual checklist — not a code issue. All other checks (tests, ESLint, typecheck, Storybook, perf-tests, builds) are still pending. Once they complete, if any code-related checks fail, feel free to tag me again and I'll investigate and fix. |
|
@aimane-chnaif @Beamanator One of you needs to 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] |
|
Thanks for volunteering to review & test this @Pujan92 ! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
Oh I was auto assigned. |
The TypeMenuSectionsParams type no longer includes this property, causing a typecheck failure. Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
Fixed the failing typecheck: removed stale |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
hahah deal thanks @aimane-chnaif |
|
The failing ESLint check is unrelated to this PR. PR changes: ESLint failures (all in unrelated files):
These are pre-existing lint errors on |
|
The ESLint check failure is unrelated to this PR. This PR only changes
These are all under |
|
The ESLint failures are unrelated to this PR's changes. This PR changes: The 6 ESLint errors are all in
These are pre-existing lint issues on |
|
The ESLint failures are unrelated to this PR's changes. All 6 errors are pre-existing issues in PR changed files: No overlap — this is a pre-existing lint issue on |
The stopGpsTrip fix (preserving the last segment when gpsPoints.length === 1) is sufficient on its own. Reverting isTripStopped back to using getTotalGpsTripPoints as the defensive change is unnecessary. Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
…meButtons Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
The ESLint failures were all in files not changed by this PR — they were pre-existing issues that got resolved on |
…hUIUtilsTest Co-authored-by: Alex Beaman <Beamanator@users.noreply.github.com>
|
The only failing check is checklist (PR Author Checklist), which is a process gate — not a code issue. All code checks (ESLint, typecheck, tests, perf-tests, Storybook) are still pending. Once they complete, if any fail, feel free to tag me again and I'll investigate. |
Pujan92
left a comment
There was a problem hiding this comment.
LGTM!
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-05-12.at.00.14.35.mov
|
No code check failures found. All completed checks are passing (ESLint, Prettier, TypeScript, React Compiler, CLA, etc.), and the remaining checks (perf-tests, spellcheck, verifySignedCommits) are still in progress. The only failed runs are PR Author Checklist and PR Reviewer Checklist, which are process checklists, not code issues. |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
Beamanator
left a comment
There was a problem hiding this comment.
@grgia want to review?
Show Resume/Save buttons when GPS tracking is stopped immediately (cherry picked from commit c393384) (cherry-picked to staging by Beamanator)
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.3.69-16 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. The change is a single-line bug fix in The existing Distance Expenses help article describes the GPS tracking flow at a high level (Start → Stop → Review → Create) and remains accurate. |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.69-18 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.3.70-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This PR fixes an internal state management bug in The existing help site articles (Distance-Expenses.md and Create-an-Expense.md) already correctly describe the GPS tracking flow (Start → Stop → Save), which remains unchanged. |
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.3.72-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a bug fix to internal GPS tracking state logic ( |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.72-1 🚀
|
Explanation of Change
When a user starts GPS tracking and immediately taps Stop before moving 100+ meters,
stopGpsTripremoves the only GPS segment (because it has 0 or 1 points), leavinggpsPoints: []. ThenisTripStoppedreturnsfalse(requires total points > 0), soGPSButtonsrenders the Start button instead of Resume/Save.This PR makes two changes in
GPSDraftDetailsUtils.ts:stopGpsTrip: Only remove an empty/single-point last segment when there are multiple segments (gpsPoints.length > 1). When it's the only segment, keep it so the trip state is preserved.isTripStopped: Check segment count (gpsPoints.length > 0) instead of point count, so it correctly returnstruewhen segments exist but are empty.The existing
zeroDistanceModalinsaveGpsTripalready handles the case where the user tries to save a zero-distance trip.Fixed Issues
$ #90103
PROPOSAL: #90103 (comment)
Tests
Offline tests
N/A — GPS tracking requires an active connection; the fix is purely state logic with no offline-specific
behavior.
QA Steps
bug: Start appeared instead)
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari