Closed Bug 2018362 Opened 8 months ago Closed 6 months ago

[meta] Reduce GLS fallback on Mac

Categories

(Toolkit :: Geolocation Provider, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: haik, Assigned: handyman)

References

Details

(Keywords: meta)

Attachments

(2 external files)

To track dependencies for reducing GLS fallback on macOS. We expect to limit the fallback to the instances where macOS System Geolocation returns Location Unknown.

Duplicate comment.

See Also: → 2018355
Component: DOM: Geolocation → Geolocation Provider
Product: Core → Toolkit
Assignee: nobody → davidp99
Severity: -- → S3

STR:

  1. Make sure geolocation permission is off for Firefox in MacOS location settings.
  2. In Firefox, go to https://browserleaks.com/geo . There should be a permission prompt that says "This will open system permission settings. Please grant permission to [browser]". Press Allow.
  3. System preferences will open. Ignore that, return to the browser and press cancel in the new prompt there.

Expected result:
The page tells you that it does not have permission and no map is shown.

Actual result:
The page opens a map to a low-accuracy location, because it used the network fallback (probably only using the users IP address and no wifi environment).


We will only allow the fallback for LocationUnknown responses, which aren't that easy to fabricate, so the manual check just ensures that we don't use the network for e.g. a permission denied response. There is an additional check to add to the STR, but it's not currently broken:

  1. Enable location permission for Firefox in MacOS settings.

Expected/Actual result:
The page opens a map to the MacOS determined location (likely high accuracy), even if no map was available before.

(We need to make sure not to break that.)

We have been (incorrectly) waiting for MacOS to reply with a location when we
get kCLErrorLocationUnknown. Other errors would fall back to the network
provider. This patch reverses the order and always falls back on
LocationUnknown. Other errors do not fall back. If the system recovers
from an error (for example, PermissionDenied is resolved by the user granting
permission), then we resume using the CoreLocationLocationProvider to get
location and we stop the network provider. These transitions are not visible
to the user. This also restores LocationUnknown telemetry tracking, since it
is meaningful again.

Pushed by daparks@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/eea05aa4dfa3 https://hg.mozilla.org/integration/autoland/rev/a5150b7f55bf Use network geolocation provider only when MacOS reports LocationUnknown r=saschanaz,jjaschke,mac-reviewers,mstange
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [qa-triage-done-c153/b152]

We have been (incorrectly) waiting for MacOS to reply with a location when we
get kCLErrorLocationUnknown. Other errors would fall back to the network
provider. This patch reverses the order and always falls back on
LocationUnknown. Other errors do not fall back. If the system recovers
from an error (for example, PermissionDenied is resolved by the user granting
permission), then we resume using the CoreLocationLocationProvider to get
location and we stop the network provider. These transitions are not visible
to the user. This also restores LocationUnknown telemetry tracking, since it
is meaningful again.

Original Revision: https://phabricator.services.mozilla.com/D298456

Attachment #9678329 - Flags: approval-mozilla-esr115?
Attachment #9678329 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: