Skip to content

[Due for payment 2026-01-06] [$250] Desktop - Money Requests - Location permission denied leaves Setting button infinite loading #75362

Closed

Description

@mitarachim

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.2.59-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: N/A
Email or phone of affected tester (no customers): jsat+todo@applausemail.com
Issue reported by: Applause Internal Team
Device used: Macbook Pro/iOS 13.7.8
App Component: Money Requests

Action Performed:

Precondition: Location permission DISABLED / Location feature OFF

  1. Login macOS Expensify App with valid credentials
  2. Click on "FAB" button.
  3. Click on "Create expense"
  4. Click on "Scan" option
  5. Choose a file
  6. Choose any recipient
  7. Click on "Create expense"
  8. Click on "Settings" button on location modal
  9. Close native settings without allowing location permission

Expected Result:

After closing native settings without allowing location permission, the "Settings" button should appear enable to click again.

Actual Result:

After closing native settings without allowing location permission, the "Settings" button remains stuck with an infinite loading spinner and cannot be accessed.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7006865_1763422179538.InfiniteLoadingButtonAfterCloseNativeSettings.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021993450791123591806
  • Upwork Job ID: 1993450791123591806
  • Last Price Increase: 2025-12-04
  • Automatic offers:
    • situchan | Contributor | 109761246
    • apeyada | Contributor | 109795947
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 18, 2025
  2. melvin-bot commented on Nov 18, 2025

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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.

  3. dmkt9 commented on Nov 18, 2025

    @dmkt9
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After closing native settings without allowing location permission, the "Settings" button remains stuck with an infinite loading spinner and cannot be accessed.

    What is the root cause of that problem?

    When the user clicks the Settings button, the app enters a loading state.


    However, since the default permission is not granted, the hasError value remains true, and the function returns early — causing the loading state to never be resolved.
    const handledBlockedPermission = (cb: () => void) => () => {
    setIsLoading(true);
    if (hasError) {
    window.electron.invoke(ELECTRON_EVENTS.OPEN_LOCATION_SETTING);
    return;
    }
    cb();
    };

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

    1. Move setIsLoading(true); below the if check.

    const handledBlockedPermission = (cb: () => void) => () => {
    setIsLoading(true);
    if (hasError) {
    window.electron.invoke(ELECTRON_EVENTS.OPEN_LOCATION_SETTING);
    return;
    }
    cb();
    };

         const handledBlockedPermission = (cb: () => void) => () => {
    -        setIsLoading(true);
             if (hasError) {
                 window.electron.invoke(ELECTRON_EVENTS.OPEN_LOCATION_SETTING);
                 return;
             }
    +        setIsLoading(true);
             cb();
         };
    1. Add setHasError to automatically switch from Settings to Continue button if the user grants permission.
      const checkPermission = useCallback(() => {
      getLocationPermission().then((status) => {
      if (status !== RESULTS.GRANTED && status !== RESULTS.LIMITED) {
      return;
      }
      onGrant();
      });
      }, [onGrant]);
         const checkPermission = useCallback(() => {
             getLocationPermission().then((status) => {
                 if (status !== RESULTS.GRANTED && status !== RESULTS.LIMITED) {
    +                setHasError(true);
                     return;
                 }
    +            setHasError(false);
                 onGrant();
             });
         }, [onGrant]);

    What alternative solutions did you explore? (Optional)

    Clear the loading state when the user returns to the app or when timeout === CONST.GPS.TIMEOUT.

    if (hasError) {
    window.electron.invoke(ELECTRON_EVENTS.OPEN_LOCATION_SETTING);
    return;
    }

             if (hasError) {
                 window.electron.invoke(ELECTRON_EVENTS.OPEN_LOCATION_SETTING);
    +            shouldClearLoadingRef.current = true;
                 return;
             }

    const unsubscribe = Visibility.onVisibilityChange(() => {
    debouncedCheckPermission();
    });

             const unsubscribe = Visibility.onVisibilityChange(() => {
                 debouncedCheckPermission();
    +            if (shouldClearLoadingRef.current && Visibility.isVisible()) {
    +                shouldClearLoadingRef.current = false;
    +                setIsLoading(false);
    +            }
             });
  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 25, 2025
  5. changed the title [-]Desktop - Money Requests - Location permission denied leaves Setting button infinite loading[/-] [+][$250] Desktop - Money Requests - Location permission denied leaves Setting button infinite loading[/+] on Nov 25, 2025
  6. melvin-bot commented on Nov 25, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 25, 2025
  8. melvin-bot commented on Nov 25, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (External)

  9. CortneyOfstad commented on Nov 25, 2025

    @CortneyOfstad
    Contributor

    Hey @ahmedGaber93! There is a proposal above for you to review – thank you!

  10. 50 remaining items

  11. CortneyOfstad commented on Dec 29, 2025

    @CortneyOfstad
    Contributor

    deployed to staging 4 hours ago! 🎉

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Dec 30, 2025
  13. changed the title [-][$250] Desktop - Money Requests - Location permission denied leaves Setting button infinite loading[/-] [+][Due for payment 2026-01-06] [$250] Desktop - Money Requests - Location permission denied leaves Setting button infinite loading[/+] on Dec 30, 2025
  14. melvin-bot commented on Dec 30, 2025

    @melvin-bot

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

  15. melvin-bot commented on Dec 30, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.88-7 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-01-06. 🎊

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

  16. melvin-bot commented on Dec 30, 2025

    @melvin-bot

    @situchan @CortneyOfstad 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. CortneyOfstad commented on Jan 5, 2026

    @CortneyOfstad
    Contributor

    @situchan — please make sure to complete the checklist before tomorrow so there is no delay in issuing payment. Thank you!

  18. situchan commented on Jan 5, 2026

    @situchan
    Contributor

    BugZero Checklist:

    • [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/57660/changes#r2662518889

    • [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:

    Regression Test Proposal

    Precondition:

    Location permission DISABLED / Location feature OFF

    Test:

    1. Click on "FAB" button.
    2. Click on "Create expense"
    3. Click on "Scan" option
    4. Choose a file
    5. Choose any recipient
    6. Click on "Create expense"
    7. Click on "Continue" button on location modal (android only)
    8. Click on "Settings" button on location modal
    9. Close native settings without allowing location permission
    10. Verify that the "Settings" (or "Continue") button appears enabled to click again

    (On web, Clicking "Got it" button creates expense immediately)

    Do we agree 👍 or 👎

  19. CortneyOfstad commented on Jan 6, 2026

    @CortneyOfstad
    Contributor

    Payment Summary

    @situchan — paid $250 via Upwork
    @apeyada — paid $250 via Upwork

    Regression Test

    https://github.com/Expensify/Expensify/issues/584807

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions