Closed Bug 1561041 Opened 5 years ago Closed 4 years ago

When navigating to Google maps the location is not detected after granting the `appPermissionRequest` and the `contentPermissionRequest`

Categories

(Core :: DOM: Geolocation, defect, P1)

Unspecified
All
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- wontfix
firefox72 --- affected

People

(Reporter: amejia, Assigned: snorp)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fenix:p1])

When navigating to Google maps the location is not detected after granting the appPermissionRequest and the contentPermissionRequest. The site request the permission multiple times even thought the permission was already granted.

This original issue from Fenix. The same issue can be seen on Gecko View Sample App and Fennec.

Something to highlight is the issue can't be seen on other map like sites like mapquest.com or openstreetmap.org, it only happens on Google Maps. I'm not sure if it has to do with the way that they are expecting the permissions to work as on Google Chrome when you grant or deny a permission, it's a permanent decision they don't use a "Don't ask again" checkbox.

Steps to reproduce

  1. With system permission for location turned off (default setting), go to google.com/maps
  2. Tap the get location button.
  3. Tap allow on the app prompt.
  4. Tap allow on the system dialog.

Expected behavior

Location is detected.

Actual behavior

The system dialog for location permission appears only the 2nd/3rd time you tap Allow on the app doorhanger.

"Google can't determine your location" error is displayed.
After system permission is set, the app's doorhanger is displayed once again.

Only works on the first try if you check the "Don't ask again" checkbox from the start.

Device information

  • Android device: Motorola Nexus 6 (Android 7.1.1), Google Pixel (Android 9), HTC 10 (Android 8.0)
    HTC Desire 820 (Android 6.0.1), Nexus 5 (Android 6), Galaxy Tab A 6 (Android 5.1.1)
  • Fenix version: 6/6
Priority: -- → P1
Whiteboard: [geckoview:fenix:m8]

I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:

e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9

Priority: P1 → P2

Agi says he can reproduce this bug intermittently. Is this a Fenix bug? I will ask the Fenix team to debug:

https://github.com/mozilla-mobile/fenix/issues/1686#issuecomment-526767572

Rank: 22
See Also: → 1527056
Whiteboard: [geckoview:fenix:m8] → [geckoview:fenix:m9]
Whiteboard: [geckoview:fenix:m9]

We should try to look at this bug in Q4. The Fenix issue mozilla-mobile/fenix#3207 is a Fenix P1 bug.

Rank: 22 → 11

This is a longstanding, intermittent issue.

Is this reproducible in GVE?

Adding to GV's November sprint because this bug is on Fenix's list of top 10 GV bugs.

Priority: P2 → P1
Whiteboard: [geckoview:m1911]

Is this reproducible in GVE?

Yes, it is.

Dylan says he will investigate.

Assignee: nobody → droeh

As far as I can tell this is not a GV bug; we're calling allow() on the permission request appropriately. I tried to compare to Fennec's behavior on the basis that it supposedly worked only to find that Fennec (ESR68.2.1) also has the same problem. Marcos, it looks like this might be a dom issue? Ping me on slack if you have trouble reproducing.

This is a top priority bug for Fenix, we really need to figure out what's happening here before 1.0

Assignee: droeh → nobody
Component: General → DOM: Geolocation
Flags: needinfo?(mcaceres)
Product: GeckoView → Core

(In reply to Dylan Roeh (:droeh) (he/him) from comment #8)

As far as I can tell this is not a GV bug; we're calling allow() on the permission request appropriately.

Oh, could you please point us to the file where allow() is called? That seems like a good starting point for investigation.

There must be something odd happening because it doesn't seem to be reproducible on other OSs (just tried on MacOS at least). Not to say that it's exclusively an Android issue, but it's a good place to start.

I tried to compare to Fennec's behavior on the basis that it supposedly worked only to find that Fennec (ESR68.2.1) also has the same problem. Marcos, it looks like this might be a dom issue? Ping me on slack if you have trouble reproducing.

Sure - but just NI'ing Garvan in case he knows someone better to work on this. It's been a couple of years since I last looked at the Geo code.

This is a top priority bug for Fenix, we really need to figure out what's happening here before 1.0

Understood.

Flags: needinfo?(gkeeley)

'Permission prompt' makes me think of mattn for advice. I am skimming dom/Geolocation/Geolocation.cpp for any ideas I might have.

Flags: needinfo?(gkeeley)

(In reply to Marcos Caceres [:marcosc] from comment #9)

(In reply to Dylan Roeh (:droeh) (he/him) from comment #8)

As far as I can tell this is not a GV bug; we're calling allow() on the permission request appropriately.

Oh, could you please point us to the file where allow() is called? That seems like a good starting point for investigation.

https://searchfox.org/mozilla-central/source/mobile/android/components/geckoview/GeckoViewPermission.js#265

Note: oddly we get two nsIContentPermissionPrompt::prompt() calls when we try to use our location in google maps. (We call allow() on both.)

There must be something odd happening because it doesn't seem to be reproducible on other OSs (just tried on MacOS at least). Not to say that it's exclusively an Android issue, but it's a good place to start.

Yeah, I haven't been able to reproduce it on desktop. It does only happen on fresh installs on Android (or at least, that's the only way I've been able to reproduce it).

I tried to compare to Fennec's behavior on the basis that it supposedly worked only to find that Fennec (ESR68.2.1) also has the same problem. Marcos, it looks like this might be a dom issue? Ping me on slack if you have trouble reproducing.

Sure - but just NI'ing Garvan in case he knows someone better to work on this. It's been a couple of years since I last looked at the Geo code.

This is a top priority bug for Fenix, we really need to figure out what's happening here before 1.0

Understood.

I'll take this one. Just finishing off another bug first - will try to get set up and going next week. @droeh, I might ping you if I have trouble things set up (never done any debugging work on Android... wish me luck! 🤞) .

Assignee: nobody → mcaceres
Status: NEW → ASSIGNED
Flags: needinfo?(mcaceres)
Whiteboard: [geckoview:m1911]

I've asked :overholt to help us find someone to take this over.

Assignee: mcaceres → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(overholt)
Assignee: nobody → snorp
Flags: needinfo?(overholt)
See Also: → 1523545

Adding Fenix priority tag.

Whiteboard: [fenix:p1]

I can't reproduce this with either GVE or Fenix Nightly. Arturo, does this still happen for you?

Flags: needinfo?(amejiamarmol)

Sorry for the late reply, now I'm not getting the "Google can't determine your location" error, the location is found after allowing twice, as I get two calls to contentPermissionRequest ,as a result, Fenix shows the prompt two times, the same can be seen in GVE

Flags: needinfo?(amejiamarmol) → needinfo?(snorp)

Ok, that's the same behavior I'm getting. Two permission requests, but location is found. I'll file a separate bug for the permission requests -- it's not clear if Maps is doing this itself or we're somehow screwing that up.

Flags: needinfo?(snorp)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.