Closed Bug 2094934 Opened 2 days ago Closed 1 day ago

Prune old synced tabs records when legacy clients disable tabs engine

Categories

(Firefox :: Sync, task)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox162 --- fixed
firefox163 --- fixed

People

(Reporter: skhamis, Assigned: skhamis)

References

(Blocks 1 open bug)

Details

Attachments

(2 external files)

https://bugzilla.mozilla.org/show_bug.cgi?id=2094362 solved half of the problem (PDS disables it's own tabs engine). However there still is an issue of if legacy clients (pre per device sync) disable the tabs engine what happens is:

  • When a legacy device turns tabs off, _updateEnabledFromMeta calls engine.wipeServer(). That deletes the whole tabs collection, removes tabs from meta/global and adds it to declined.
  • On the PDS device, _resolveEngineMetaPerDevice deliberately falls back to the sync ID registry, so the sync ID stays the same ("Keeps the generation if a legacy client removes its meta/global entry"). With no sync ID change there's no reset, so no wipe_remote_tabs.
    The next fetch is incremental (newer=lastSync). The legacy device's record no longer exists on the server, so the fetch can't bring back anything to replace or delete it. The local row stays.
  • getAllClients() only checks that the device is still in the clients collection, and it is. The old tabs show until the TTL cleanup or until the device disconnects.
Assignee: nobody → skhamis
Status: NEW → ASSIGNED
Pushed by skhamis@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d63667c96f63 https://hg.mozilla.org/integration/autoland/rev/ef81a295414b Prune old synced tabs records when legacy clients disable engine r=markh,sync-reviewers
Pushed by csabou@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b844fbf1858f https://hg.mozilla.org/integration/autoland/rev/541eacbc365a Revert "Bug 2094934 - Prune old synced tabs records when legacy clients disable engine r=markh,sync-reviewers" for causing failures on test_remote_tabs.

Backed out for causing failures on test_remote_tabs.

Push with failures

Failure log

Backout link

Flags: needinfo?(skhamis)

nit: I had to read this (and the patch) a few times to understand the problem (local record isn't replaced because the wipe doesn't happen) and what was being done about it. It feels like this description would've benefited from a summary of what the patch was going to do, i.e. ensure the PDS client reads all remote tab records.

A quick claude foray shows that the failure is because the MockTabsEngine.prototype in browser/components/urlbar/tests/unit/test_remote_tabs.js doesn't have an "enabled" property, so the short circuit in SyncedTabs.sys.mjs errors.

Pushed by skhamis@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a564c3c5628b https://hg.mozilla.org/integration/autoland/rev/82aa164bccf4 Prune old synced tabs records when legacy clients disable engine r=markh,sync-reviewers,urlbar-reviewers,adw
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
Flags: needinfo?(skhamis)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Per device syncing is implemented in 162. This is a fix that is needed for PDS to work properly
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Fairly small code surface and is more of a cleanup of tabs records (Which get re-uploaded every sync even if we accidentally did it) so relatively safe.
  • String changes made/needed?: N/A
  • Is Android affected?: no
Attachment #9687507 - Flags: approval-mozilla-beta?
Attachment #9687507 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: