Skip to content

[Due for payment 2026-04-30] [Due for payment 2026-04-28] Android - GPS - Map does not load when opening track GPS when tracking is ongoing #88041

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.60-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: #87103
Email or phone of affected tester (no customers): soidnjsoidjoisjdiosj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Samsung Galaxy S25 FE / Android 16
App Component: Money Requests

Action Performed:

Precondition:

  • App location access is allowed.
  1. Launch Expensify app.
  2. Tap + > Track distance > GPS.
  3. Tap Start.
  4. Tap app back button.
  5. Tap GPS tracking in progress.

Expected Result:

Map will load.

Actual Result:

Map does not load and is stuck on Map pending view.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Image

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @dukenv0307

Activity

  1. added
    DeployBlockerCash
    Bug
    on Apr 16, 2026
  2. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #87103

  3. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 16, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Apr 16, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #87103 - "Add a map on the GPS screen that shows the trip live" by @GCyganek (High confidence)
    Related Issues: 86026

    Recommendation: REVERT

    PR 87103 introduced the Mapbox map to the GPS distance screen. When the user navigates away (presses the device back button) and returns via "GPS tracking in progress", the screen remounts, calls initMapboxToken() again, and must wait for the Mapbox access token to resolve asynchronously. Until isAccessTokenSet becomes true in MapView.tsx, the PendingMapView is shown instead of the actual map, leaving the user stuck on the pending view.

    Assigned: @GCyganek (PR author), @dukenv0307 and @puneetlath (approving reviewers)
    Labels: DeployBlockerCash kept (this is a frontend App bug). No label changes needed.

    Detailed Analysis:

    Evidence:

    • The melvin-bot assigned PR 87103 as the causing PR based on timing/authorship
    • PR 87103 is the first PR to introduce a Mapbox map view into IOURequestStepDistanceGPS/index.native.tsx
    • The issue is staging-only (new feature, does not exist in production), and PR 87103 is the staging PR adding this map
    • Bug reproduction steps match exactly: start GPS tracking, press back, return via "GPS tracking in progress" prompt causes remount

    Verification:

    • Affected file: src/pages/iou/request/step/IOURequestStepDistanceGPS/index.native.tsx
    • PR 87103 modified this file directly (adding DistanceMapView and Mapbox token lifecycle)
    • PR 87103 added initMapboxToken() / stopMapboxToken() via useEffect at component mount/unmount
    • MapView.tsx only renders the map when: !isOffline && isAccessTokenSet && !!defaultSettings (line 253)

    Root Cause:
    In MapView.tsx, isAccessTokenSet starts as false and only flips to true after setAccessToken(accessToken).then(...) resolves. When the user presses the Android back button and returns to the GPS screen via the "GPS tracking in progress" notification, the component unmounts (calling stopMapboxToken) and remounts (calling initMapboxToken()). The mapboxAccessToken Onyx value must be re-fetched and setAccessToken must resolve before the map appears. It appears this async resolution does not complete, so the PendingMapView is shown indefinitely.

  6. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The Android-only DistanceMapView wrapper maintains an isMapReady state (initialized to false) that shows a "Map pending" overlay until the inner MapView fires onMapReady. This callback only fires inside setMapIdle, which is the handler for Mapbox's onMapIdle event.

    When the user navigates away, isIdle is set to false on blur. When the user navigates back, the component either remounts (resetting isMapReady to false) or persists with isIdle=false. In both cases, Mapbox on Android doesn't reliably re-fire onMapIdle for an already-loaded/idle map, so onMapReady never fires again and the pending overlay stays visible.

    The non-Android DistanceMapView simply renders MapView with no overlay, which is why this is Android-only.

    What changes do you think we should make in order to solve the problem?

    Add a focus listener in MapView.tsx (alongside the existing blur listener at line 159) that re-triggers onMapReady when the screen regains focus and the map was previously ready. This ensures the Android DistanceMapView overlay gets dismissed on re-navigation.

    Alternatively, in DistanceMapView/index.android.tsx, listen for the navigation focus event and call onMapReady if the underlying Mapbox view is already rendered (i.e., isAccessTokenSet is true and the map was previously loaded). This avoids modifying the shared MapView component.

    What alternative solutions did you explore? (Optional)

    • Removing the Android overlay entirely: Not viable — the overlay exists to handle the slow initial map load on Android devices.
    • Using onMapIdle with a focus-triggered camera move: Could force Mapbox to re-fire onMapIdle by nudging the camera on focus, but this is a hack and could cause visible map jitter.
    Investigation details

    Evidence chain:

    1. DistanceMapView/index.android.tsx:16 — isMapReady state starts false, overlay shown at line 35
    2. MapView.tsx:182-189 — onMapReady only called inside setMapIdle (the onMapIdle handler)
    3. MapView.tsx:159-164 — isIdle reset to false on navigation blur
    4. MapView.tsx:258 — onMapIdle={setMapIdle} is the only trigger for the idle→ready chain
    5. On re-navigation, Mapbox Android doesn't re-fire onMapIdle for an already-idle map, breaking the chain

    Why Android-only: DistanceMapView/index.tsx (non-Android) is just a passthrough to MapView with no overlay logic.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. GCyganek commented on Apr 16, 2026

    @GCyganek
    Contributor

    checking...

  8. GCyganek commented on Apr 16, 2026

    @GCyganek
    Contributor

    Fixed, posting a PR in a moment, thanks for reporting this!

  9. added
    Reviewing
    on Apr 16, 2026
  10. m-natarajan commented on Apr 16, 2026

    @m-natarajan

    Passed, Xiaomi Redmi Note 10 / Android 12, App 9.3.60-9

    Screenrecorder-2026-04-16-23-21-30-784.mp4
  11. removed
    DeployBlockerCash
    Hourly
    on Apr 17, 2026
  12. added
    Daily
    and removed
    Reviewing
    on Apr 21, 2026
  13. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. changed the title [-]Android - GPS - Map does not load when opening track GPS when tracking is ongoing[/-] [+][Due for payment 2026-04-28] Android - GPS - Map does not load when opening track GPS when tracking is ongoing[/+] on Apr 21, 2026
  15. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 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-04-28. 🎊

    For reference, here are some details about the assignees on this issue:

    • @GCyganek does not require payment (Contractor)
    • @dukenv0307 requires payment through NewDot Manual Requests
  16. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    @dukenv0307 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]

  17. changed the title [-][Due for payment 2026-04-28] Android - GPS - Map does not load when opening track GPS when tracking is ongoing[/-] [+][Due for payment 2026-04-30] [Due for payment 2026-04-28] Android - GPS - Map does not load when opening track GPS when tracking is ongoing[/+] on Apr 23, 2026
  18. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.61-4 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-04-30. 🎊

    For reference, here are some details about the assignees on this issue:

    • @GCyganek does not require payment (Contractor)
    • @dukenv0307 requires payment through NewDot Manual Requests
  19. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    @dukenv0307 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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions