Open Bug 1866542 Opened 2 years ago

History syncing doesn't delete visits

Categories

(Application Services :: Places, defect, P3)

Tracking

(Not tracked)

People

(Reporter: markh, Unassigned)

Details

From github: https://github.com/mozilla/application-services/issues/5472.

I'm pretty sure this is how we sync history visits for each record:

  • We fetch the history record from the server, which contains the "20 most recent visits" for the URL.
  • We insert a row for any visit, skipping visits that we already know about:
    • In plan_incoming_record() we filter out visits that match a row in moz_historyvisits with the same timestamp/transition pair.
    • In apply_synced_visits() we skip over visits that match the timestamp from moz_historyvisit_tombstones (this is slightly inconsistent with how plan_incoming_record uses timestamp+transition, but that's not a big issue).
  • We then send the history record with our most recent 20 visits as an outgoing record -- if we detect local changes from the server.

If I'm correct about the system, this does not allow clients to signal deletion of visits. For example:

  • I visit a this-week-in-rust on my desktop
  • I sync my desktop and phone, now my phone has the visit in it's database
  • On my desktop, I delete history from the last hour. This deletes the visit, but not the history record since I have older visits to this week in rust.
  • I sync on desktop, results in a history record for https://this-week-in-rust.org/ without the latest visit
  • I sync on my phone, which sees the history record with the missing visit. It assumes the record is incomplete and uploads a history record with the visit back
  • When desktop syncs, it has the visit in it's tombstones, so it doesn't re-add the visit. However, the visit is still on my phone.

I tried to test that this morning and this seemed to be the result -- although it seemed like I needed to sync several times before history sync worked as I expected, so maybe I'm missing something.

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

You need to log in before you can comment on or make changes to this bug.