firefox-ios icon indicating copy to clipboard operation
firefox-ios copied to clipboard

Sync data is not deleted across devices

Open data-sync-user opened this issue 1 year ago • 8 comments

When data is deleted from one device it is not reflected on other synced device.

Steps to reproduce

  • Clear Private Data in Data Management inside Settings and remove all bookmarks form first device.
  • Click on Sync now in settings.
  • Log in on second device.

Expected behavior

  • All data is removed from user account.

Actual behavior

  • History, bookmarks are imported as soon as logged in on new device.

Device & build information

  • Device: iPhone 14 Pro, iOS 17.5.1
  • Build version: 129.0(1)
  • First seen version: 129.0(1)

┆Issue is synchronized with this Jira Task

data-sync-user avatar Jun 13 '24 13:06 data-sync-user

➤ Norberto Andres Furlan commented:

Andrei Bodea can you try to reproduce this one?

data-sync-user avatar Jun 20 '24 19:06 data-sync-user

➤ Norberto Andres Furlan commented:

Lougenia Bailey Mark Hammond can you check this one? Thanks!

data-sync-user avatar Jun 20 '24 19:06 data-sync-user

➤ Mark Hammond commented:

If all bookmarks are deleted from one device connected to sync, we would expect them to be deleted on all devices connected to the same account.

data-sync-user avatar Jun 20 '24 19:06 data-sync-user

➤ Razvan Litianu commented:

In my observations, bookmarks and browsing history are handled differently. Deleting bookmarks works as expected: the changes sync across all devices, and only the synced bookmarks appear when logging into a new device. However, browsing history behaves differently. It is additive, meaning new history from other devices is added, but deletion is device-specific. When deleting all history on one device (e.g., a desktop), residual history might remain due to continuous usage or history specific to that device.

Is that correct Mark Hammond?

data-sync-user avatar Jul 17 '24 07:07 data-sync-user

➤ Mark Hammond commented:

Sorry for the delay - I think I wrote something about this in another Jira ticket but can’t find it.

History is somewhat complicated, because the unit of syncing is individual visits to sites. If you delete individual visits, then the syncing of that deletion should sync. In practice though, that’s not obvious to the user - the site still remains with other vists recorded, and it may have a lower “frecency” (ie, may be considered “less important”) but because there’s not much ui on mobile to show you these visits it’s not obvious what’s going on. Deleting all history, or all visits for a site should also sync correctly. The app-services “places” component offers all these capabilities, so exactly what to expect depends on which of these are being used.

Bookmarks don’t really have the same problem - a bookmark either exists or it does not. For the purposes of this bug, I’d suggest focusing just on bookmarks, because the semantics are much clearer. If something is preventing bookmarks from behaving as expected in this scenario, I’d expect history also also not work as expected for the same reason. Once bookmarks are demonstrated as working as expected, if history still is not it’s likely that will be due to visit/place complications above.

data-sync-user avatar Jul 22 '24 15:07 data-sync-user

➤ Matt Reagan commented:

Can anyone confirm if we have enough information yet to define clear action items for this ticket? I feel like there may be some conflicting information. The original ticket mentions:

{quote}Expected Behavior: All data is removed from user account.

Actual Behavior: History, bookmarks are imported as soon as logged in on new device.{quote}

But this seems to be partly in contrast to Razvan Litianu 's investigation:

{quote}Deleting bookmarks works as expected: the changes sync across all devices{quote}

and specific to history:

{quote}It is additive, meaning new history from other devices is added, but deletion is device-specific{quote}

and from Mark Hammond :

{quote}History is somewhat complicated, because the unit of syncing is individual visits to sites{quote}

So based on the above I’m not entirely clear on what the expected behavior actually is and whether there is a bug only with history sync, or additionally with bookmarks (or with neither).

data-sync-user avatar Jul 31 '24 18:07 data-sync-user

➤ Tushar Chitnavis commented:

Matt Reagan , the original purpose of this ticket was to check the history cleanup on synced devices. Bookmarks deletion syncs properly, but I observed history being loaded on new devices after login, even after being deleted from old device.

data-sync-user avatar Jul 31 '24 19:07 data-sync-user

➤ Roux Buciu commented:

Norberto Andres Furlan to prioritize

data-sync-user avatar Aug 27 '24 17:08 data-sync-user

➤ Matt Reagan commented:

I’ve updated the ticket description to hopefully reflect what appears to be the principal issue, since it sounds like Bookmark syncing is working correctly.

{quote}Deleting all history, or all visits for a site should also sync correctly. The app-services “places” component offers all these capabilities, so exactly what to expect depends on which of these are being used.{quote}

Mark HammondWhen history is cleared in Data Management the iOS client calls into profile.places.deleteEverythingHistory() and then profile.places.deleteHistoryMetadataOlderThan(olderThan: INT64_MAX), this is in addition to the local data that we clear (image caches, tabs, etc.).

Per your previous comment can you advise if the iOS client is potentially calling into the wrong service API? So far from what I can see it looks like the client is performing the clear correctly and this might be an A/S issue.

data-sync-user avatar Aug 29 '24 19:08 data-sync-user

➤ Mark Hammond commented:

deleteEverythingHistory doesn’t sync the deletions for better or worse - but this matches desktop - https://bugzilla.mozilla.org/show_bug.cgi?id=578694 ( https://bugzilla.mozilla.org/show_bug.cgi?id=578694|smart-link ). deleteVisitsBetween might work here, but it’s always going to be a little brittle because we’ve only synced the last 5k records, so records we didn’t delete because we didn’t know about will still come in on other devices.

So I think history is going to be a little problematic, and I apologize for not noting this earlier. Bookmarks should work fine though.

data-sync-user avatar Aug 29 '24 19:08 data-sync-user

➤ Matt Reagan commented:

Mark Hammond Am I understanding correctly then that we don’t have a perfect solution for this at present? It sounds like deleteEverythingHistory is working the same as desktop (but perhaps not the way users might expect, e.g. 578694). And deleteVisitsBetween would potentially still result in old records showing up also?

data-sync-user avatar Aug 29 '24 19:08 data-sync-user

➤ Mark Hammond commented:

Yeah, none of our products have a good solution for history. If the user really wants all history from the server deleted, they can disable history syncing, and the next sync all records on the server will be removed - but I don’t think that actually helps in this scenario (ie, the user isn’t going to discover that by themselves)

data-sync-user avatar Aug 29 '24 19:08 data-sync-user

➤ Matt Reagan commented:

Norberto Andres Furlan Going to tentatively close this ticket for now based on Mark’s comments, since iOS is working similarly to desktop and I don’t believe we have a viable solution for this currently. Please LMK however if you’d prefer we keep this ticket open.

data-sync-user avatar Aug 29 '24 20:08 data-sync-user