There are a few errors in telemetry like
Can't merge local kind (Bookmark|Folder) and remote kind (Folder|Bookmark). I was thinking old livemarks might be to blame...but, in that case, the kind should be
Folder, and the migrator uses fresh GUIDs when converting livemarks to bookmarks.
However, these two maintenance tasks change the type, but keep the original GUID. That worked for the old bookmarks engine, which removed the old local item and inserted the one from the server. But the new one fails the sync. We should fix that maintenance task to also change the GUID, and upload a tombstone for the old one if it's syncing.
For items that are already on the server, it's trickier. We don't want to cause data loss by deleting the bookmark, but we also don't want to keep useless duplicates around. I think our strategy can be something like:
- If we're replacing a bookmark with an empty folder, keep the bookmark and delete the folder.
- If we're replacing a bookmark with a non-empty folder, keep both.
- For bookmarks on both sides, if it doesn't have a URL, flag it as
Replace. We already do this for remote bookmarks when we store them in the mirror, but assume local ones are always
(3) means that, if we're replacing a bookmark without a URL with an empty folder, we'll delete both...and, if the folder does have children, we'll only keep the folder.
There's an old Dogear PR that we can resurrect and tweak a bit.