зеркало из https://github.com/mozilla/gecko-dev.git
99b7c7c7de
This commit introduces a Rust XPCOM component, `mozISyncedBookmarksMerger`, that wraps the Dogear crate for merging and applying synced bookmarks. How this works: `SyncedBookmarksMirror.jsm` manages opening the connection, initializing the schema, and writing incoming items into the mirror database. The new `mozISyncedBookmarksMerger` holds a handle to the same connection. When JS code calls `mozISyncedBookmarksMerger::apply`, the merger builds local and remote trees, produces a merged tree, applies the tree back to Places, and stages outgoing items for upload in a temp table, all on the storage thread. It then calls back in to JS, which inflates Sync records for outgoing items, notifies Places observers, and cleans up. Since Dogear has a more robust merging algorithm that attempts to fix up invalid trees, `test_bookmark_corruption.js` intentionally fails. This is fixed in the next commit, which changes the merger to handle invalid structure. Differential Revision: https://phabricator.services.mozilla.com/D20076 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
src | ||
.cargo-checksum.json | ||
Cargo.toml | ||
LICENSE | ||
README.md |
README.md
Dogear
Dogear is a library that implements bookmark tree merging for Firefox Sync. It takes two trees—a valid, consistent local tree, and a possibly inconsistent remote tree—and produces a complete merged tree, with all conflicts and inconsistencies resolved.
Dogear implements the merge algorithm only; it doesn't handle syncing, storage, or application. It's up to the crate that embeds Dogear to store local and incoming bookmarks, describe how to build a tree from a storage backend, persist the merged tree back to storage, and upload records for changed bookmarks.
Requirements
- Rust 1.31.0 or higher