Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Multiple bugs when we deny location permission and then ask for it again #38

Open
1 of 2 tasks
tomasbaran opened this issue May 6, 2020 · 1 comment
Open
1 of 2 tasks

Comments

@tomasbaran
Copy link

tomasbaran commented May 6, 2020

🐛 Bug Report

These are minor bugs but I wanted to report them anyway. There are actually 3 different bugs but I believe they are related so I'm reporting them as one.

Expected behavior

Bug A

there shouldn't be ERROR_ALREADY_REQUESTING_PERMISSION

Bug B

Request permission pop up shouldn't get stuck and should pop up right away.

Bug C

There should NOT be this error:
IMG_13BCC33E7FB4-1

Reproduction steps

For reproduction, please see this repo: https://github.com/tomasbaran/location_permissions

Bug A

  1. Tap Don't Allow
  2. Tap Enable Location
  3. Set Ask Next Time (but iOS doesn't refresh the status, so please go back one step and then do it)
  4. Go back to the app
  5. Tap Don't Allow
  6. Set Ask Next Time (but iOS doesn't refresh the status, so please go back one step and then do it)
  7. Now it throws an error which I don't believe makes sense since there was no requested permission running: PlatformException(ERROR_ALREADY_REQUESTING_PERMISSION, A request for permissions is already running, please wait for it to finish before doing another request., null)

Bug B

  1. Tap Don't Allow
  2. Tap Enable Location
  3. Set Ask Next Time (but iOS doesn't refresh the status, so please go back one step and then do it)
  4. Wait 10 seconds (if you don't wait for 10 seconds and you do it right away, everything works as it should)
  5. Go back to the app
  6. The Requested Permission Pop up got stuck: doesn't throw any error but doesn't pop up the Permission request.

This issue always happens on Simulator and sometimes happens on real iPhone sometimes not

Bug C

  1. Tap Don't Allow
  2. Tap Enable Location
  3. Set Allow Always (but iOS doesn't refresh the status, so please go back one step and then do it)
  4. Go back to the app
  5. Throws a '!debugLocked is not true' error

Configuration

Version: 2.0.5

Platform:

  • 📱 iOS
  • 🤖 Android
@milhomem
Copy link

@tomasbaran I checked your repo and I believe that at least for Bug C your problem is that you are calling the method on initState() and that's not correct because the widget will not be mounted.

This will end up calling the method multiple times.

Please see https://www.didierboelens.com/2019/04/addpostframecallback/ for detailed information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants