Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2709 revpos support #5037

Merged
merged 1 commit into from Apr 14, 2016
Merged

2709 revpos support #5037

merged 1 commit into from Apr 14, 2016

Commits on Apr 7, 2016

  1. (#2709) - support revpos in attachment stubs

    Add the `revpos` property to attachment stubs on save. `revpos` is the doc's
    `rev` prefix (a sequential number) from when the attachment was added or
    updated. It is used during replication in the CouchDB replicator (and others
    including CouchBase Lite) to avoid fetching attachments that have not changed
    since last replication.
    
    This solves a problem with attachments created in PouchDB, which are then
    replicated to an Apache CouchDB instance. They end up having a `revpos` property
    set to `0`. When the doc is later pull replicated from an iOS application using
    CouchBase Lite it is skipped and does not get replicated. This is because CBL
    rejects attachments with invalid attachment stub (see
    couchbase/couchbase-lite-ios#1200). `revpos:0` is
    considered invalid in CBL.
    
    Also this improves replication performance of documents with attachments created
    by PouchDB, when they are later replicated using Apache CouchDBs own replicator.
    The Apache CouchDB replicator itself handles `revpos:0` docs without a problem.
    But the replication of those docs cannot be optimized; the attachments get
    copied over again for every revision, even if they did not change.
    Johannes J. Schmidt committed Apr 7, 2016
    Copy the full SHA
    50d53a6 View commit details
    Browse the repository at this point in the history