Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Distance] - Unable to use current location once the site location access is denied #26483

Closed
1 of 6 tasks
lanitochka17 opened this issue Sep 1, 2023 · 11 comments
Closed
1 of 6 tasks
Assignees
Labels
Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 1, 2023

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


Issue found when executing PR #25990

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to + > Request money > Distance
  3. Go to Start > Use current location
  4. Allow location permission
  5. Turn off location permission
  6. Refresh the page
  7. Click Use current location
  8. Reset site permission
  9. Refresh the page
  10. Click Use current location
  11. Click Allow

Expected Result:

Every time location access on browser is allowed, the app is able to use current location feature

Actual Result:

Once the location access is denied on the mobile browser, the app is unable to use current location feature when the location access is re-enabled

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.61-1

Reproducible in staging?: Yes

Reproducible in production?: No

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Bug6184890_Screen_Recording_20230901_175759_Chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal team

Slack conversation:

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Sep 1, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Sep 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

Triggered auto assignment to @srikarparsi (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@pecanoro
Copy link
Contributor

pecanoro commented Sep 1, 2023

I was looking into another deploy blocker linked to this, but I encountered this problem as well. The current location is super buggy lol It also does not work if you delete the current address and try to use the current location.

@huzaifa-99
Copy link
Contributor

I will be fixing this with a new PR (taking changes from #25990)

cc: @hayata-suenaga @narefyev91

@pecanoro
Copy link
Contributor

pecanoro commented Sep 1, 2023

Since the original PR was reverted, I am removing the deploy blocker label!

@pecanoro pecanoro added Daily KSv2 and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment labels Sep 1, 2023
@huzaifa-99
Copy link
Contributor

Update: Once the location permission is denied then allowed again, chrome is doing some weird caching I believe, which is why it will still think that the location permission is denied. Resetting the permissions via chrome solves the issue.

@huzaifa-99
Copy link
Contributor

huzaifa-99 commented Sep 1, 2023

I believe this is expected behavior for Chrome. From what I could find (and apologies this is from ChatGPT as I couldn't find any official docs from Chrome) there is a term for it "browser permission persistence" / "permission state persistence".

It's also on other websites like this one -> https://permission.site and to add this site is maintained by chromium itself GH -> https://github.com/chromium/permission.site.

To get around this we have to close and reopen the browser tab after we denied permission and then reallowed it. If that doesn't work, we would have to "Reset Permissions"

image

Apologies if this doesn't sound very helpful but tbh we are not doing anything unexpected, we are just calling the navigator.geolocation.getCurrentPosition which is a native browser feature, and that call is failing when we deny permission (but it works again if we close and reopen tab).

I also checked if there are any configurations (third param for getCurrentPosition) for navigator.geolocation.getCurrentPosition that may solve this but none exists from what i found.

cc: @hayata-suenaga @srikarparsi

@hayata-suenaga
Copy link
Contributor

hayata-suenaga commented Sep 1, 2023

@huzaifa-99

Thank you for the detailed investigation. I really appreciate your effort in investigating the issue and providing very clear summaries.

If this is the browser behavior, then there is nothing we can do. Let's close this issue

@huzaifa-99
Copy link
Contributor

Thanks, I believe we could add some docs about this to the help site (https://help.expensify.com) or update this error message for Chrome accordingly.

image

Thoughts @hayata-suenaga?

@hayata-suenaga
Copy link
Contributor

That's a good idea

@huzaifa-99 this is a low priority task, so you can answer this when you have time. I just wanted to confirm the solution for this

  • After user denies the permission if then they want to grant location permission again, what should they do?

Memo video for myself

Screen.Recording.2023-09-01.at.3.34.49.PM.mov

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 2, 2023
@huzaifa-99
Copy link
Contributor

After user denies the permission if then they want to grant location permission again, what should they do?

Whenever the user changes location permissions, they should reload the page (Chrome will automatically suggest that). If they denied and then allowed permission then the current Chrome tab will show the location denied error even when it's allowed.

In this case, a user can either

A. Close and reopen the same tab
B. Reset Website Permissions

cc: @hayata-suenaga

@lanitochka17 lanitochka17 changed the title Distance - Unable to use current location once the site location access is denied [Distance] - Unable to use current location once the site location access is denied Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants