Merge lp:~jamesh/bindwood/sync-pull-changes into lp:bindwood
Status: | Merged |
---|---|
Approved by: | Zachery Bir |
Approved revision: | 37 |
Merged at revision: | 31 |
Proposed branch: | lp:~jamesh/bindwood/sync-pull-changes |
Merge into: | lp:bindwood |
Prerequisite: | lp:~jamesh/bindwood/recording-observer |
Diff against target: |
263 lines (+240/-1) 2 files modified
modules/sync.jsm (+100/-1) mozmill/tests/test_sync_pullchanges.js (+140/-0) |
To merge this branch: | bzr merge lp:~jamesh/bindwood/sync-pull-changes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zachery Bir (community) | Approve | ||
Eric Casteleijn (community) | Approve | ||
Review via email: mp+49407@code.launchpad.net |
Commit message
Add a Synchroniser.
Description of the change
Code to retrieve changes from CouchDB. There are two modes of operation:
1. on initial sync, or if the last sync point has been compacted out of the DB, return all rows. A view is used to filter to just the given profile.
2. on subsequent pulls, the changes feed is used to retrieve just the changed documents. A filter is used to remove changes to other profiles.
The changed records are fed to the Synchroniser.
Some of the complexity in this code comes from trying to handle records marked as deleted by desktopcouch. I've tried to make the handling of these as close to actual deleted records as I can.
Oh, you won't have to deal with documents marked deleted anymore (well as long as nothing breaks very badly when encountering them, as people may or may not have upgraded their desktopcouch software):
Documents that are deleted, should now *really* be deleted, and moved to the /dc_trash database, under an autogenerated new id, and with an added annotation, like: