Closed Bug 2060572 Opened 3 months ago Closed 2 months ago

Invalidate the NetworkGeolocationProvider request cache on network link changes, and count how often that happens

Categories

(Toolkit :: Geolocation Provider, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: jstutte, Assigned: handyman)

References

(Blocks 2 open bugs)

Details

Attachments

(3 external files, 3 obsolete files)

Bug 2048118 part 4 landed the network request cache, but the half that invalidated it on network:link-status-changed was obsoleted (attachment 9603235 [details]) and never landed. If WiFi is absent, the cached position therefore has no invalidation trigger at all, a laptop that is suspended with an open FIrefox and re-opened in a different network will see the old position. From telemetry it seems that the vast majority of requests have no AP information.

Chromium does exactly this, including the placement: PositionCacheImpl (services/device/geolocation) is itself a net::NetworkChangeNotifier::NetworkChangeObserver.

down is deliberately ignored: losing the link cannot make a cached position wrong, and up/down are edge-triggered on a state transition (NetlinkService::UpdateLinkStatus), so any return of the link fires up and invalidates before the first request that could be served from the stale entry.

We may also want to add a missing measurement, since there is no probe for link-change frequency anywhere in netwerk/, toolkit/ or dom/ today.

Type: defect → task
Type: task → enhancement
See Also: → 2060571

The cached position therefore has no invalidation trigger at all

Shouldn't AP list change still trigger the invalidation? I guess there's cases where initial location has no AP at all and the new location still has none.

(In reply to Kagami Rosylight 🏳️‍🌈🏳️‍⚧️ [:saschanaz] (they/them) from comment #1)

The cached position therefore has no invalidation trigger at all

Shouldn't AP list change still trigger the invalidation? I guess there's cases where initial location has no AP at all and the new location still has none.

Yes, and from telemetry this seems to not be an edge case. But comment 0 was wrong in saying never.

Severity: -- → N/A
Severity: N/A → --
Severity: -- → N/A
Duplicate of this bug: 2064958

Observe network:link-status-changed and invalidate the network geolocation
cache on "changed"/"up". A cached location is only valid on the network it
came from. The observer lives on the cache, so invalidation also works while
the provider is shut down.

Assignee: nobody → davidp99
Status: NEW → ASSIGNED

CachedRequest/CachedResponse refactor. No functional change.

Attachment #9643620 - Attachment description: Bug 2060572 - Part 1: Invalidate the NetworkGeolocationProvider request cache on network link changes. r=#geoprovider-reviewers! → Bug 2060572 - Part 2: Invalidate the NetworkGeolocationProvider request cache on network link changes. r=#geoprovider-reviewers!
Attachment #9643621 - Attachment description: Bug 2060572 - Part 2: Add telemetry for the network changes that geolocation sees. r=#geoprovider-reviewers! → Bug 2060572 - Part 3: Add telemetry for the network changes that geolocation sees. r=#geoprovider-reviewers!
Pushed by daparks@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/864c6faa302d https://hg.mozilla.org/integration/autoland/rev/4250d0cd3517 Part 1: Refactor the NetworkGeolocationProvider request cache. r=geoprovider-reviewers,jjaschke,saschanaz https://github.com/mozilla-firefox/firefox/commit/ba987011e3b7 https://hg.mozilla.org/integration/autoland/rev/374666d46eaf Part 2: Invalidate the NetworkGeolocationProvider request cache on network link changes. r=geoprovider-reviewers,saschanaz https://github.com/mozilla-firefox/firefox/commit/5fa7c2e9a3a2 https://hg.mozilla.org/integration/autoland/rev/117abd42dc4e Part 3: Add telemetry for the network changes that geolocation sees. r=geoprovider-reviewers,saschanaz
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
QA Whiteboard: [qa-triage-done-c159/b158]
Duplicate of this bug: 2076922

CachedRequest/CachedResponse refactor. No functional change.

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

Attachment #9678341 - Flags: approval-mozilla-esr115?

Observe network:link-status-changed and invalidate the network geolocation
cache on "changed"/"up". A cached location is only valid on the network it
came from. The observer lives on the cache, so invalidation also works while
the provider is shut down.

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

Attachment #9678343 - Flags: approval-mozilla-esr115?
Attachment #9678344 - Flags: approval-mozilla-esr115?
Attachment #9678341 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9678343 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9678344 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9678341 - Attachment is obsolete: true
Attachment #9678341 - Flags: approval-mozilla-esr115+ → approval-mozilla-esr115-
Attachment #9678343 - Attachment is obsolete: true
Attachment #9678343 - Flags: approval-mozilla-esr115+ → approval-mozilla-esr115-
Attachment #9678344 - Attachment is obsolete: true
Attachment #9678344 - 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: