<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 9:28 AM, Kit Cambridge <span dir="ltr"><<a href="mailto:kcambridge@mozilla.com" target="_blank">kcambridge@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
Tomorrow's Nightly will include some improvements to how we track<br>
bookmark changes for syncing [1]. I wanted to take some time to<br>
summarize them in this email.<br>
<br>
Previously, Sync listened for observer notifications from Places [2],<br>
recorded the changes in memory, and periodically flushed them to disk.<br>
This caused Sync to occasionally miss changes at startup or during a<br>
sync, and lose changes from interrupted syncs.<br>
<br>
The fix moves the change tracking logic into Places. Instead of using<br>
observers, the new bookmarks tracker pulls the set of changed<br>
bookmarks directly from the database. A new "change counter" column<br>
increments every time a bookmark is modified in a way that should<br>
trigger a sync, and decrements once the bookmark has been successfully<br>
uploaded to the server. The counter is updated in a transaction,<br>
ensuring we don't lose changes at startup or shutdown. This design<br>
also avoids missing changes during a sync.<br>
<br>
We think these lost changes are responsible for a large portion of<br>
corrupt server bookmark trees. This corruption can spread to other<br>
devices, and blocks us from enabling bidirectional syncing on iOS.<br>
We've developed a two-pronged mitigation strategy: prevent Sync from<br>
corrupting the server in the first place, and repair existing<br>
corruption by uploading missing bookmarks. The tracker improvements<br>
are a form of prevention, and repair is currently in the works [3].<br>
<br>
If you're using Sync, I encourage you to install the About Sync add-on<br>
[4], and validate your bookmarks [5]. We want to make sure the new<br>
tracker doesn't introduce new errors. If you've been using Sync for a<br>
while, it's likely you'll already have some validation errors. We want<br>
to know about these, too, so that we can prioritize our repair<br>
efforts. Please file new bugs in the "Firefox :: Sync" component on<br>
Bugzilla, or reply to this thread.<br>
<br>
Special thanks to Marco Bonardo, Mark Hammond, Richard Newman, and<br>
Thom Chiovoloni for all their insightful feedback and reviews!<br></blockquote><div><br></div><div>This is a really big deal.  Great work rebuilding one of the cruftiest parts of Desktop Sync.  This is how we get to a better world!<br><br></div><div>Huge ups to the reviewers, too -- this would be hard to write, let alone swap in and juggle all the interactions...<br><br></div><div>Nick<br></div></div></div></div>