Include id with bulkDocs() results even in case of conflicts? #6039

Closed
nolanlawson opened this Issue Dec 20, 2016 · 2 comments

Projects

None yet

2 participants

@nolanlawson
Member

I'm not sure if this matches the CouchDB behavior or not, but Ben Nadel lays out a pretty good case for why it's annoying that the response to bulkDocs() doesn't include the original ID for conflicted documents. You essentially have to keep track of the request as well as the response object, which is a lot of bookkeeping.

If we were to implement this, and if CouchDB didn't support it, then we'd have to do the bookkeeping ourselves, but it may be worth it. Unless folks feel this is fine being solved in plugin-land.

@willholley
Member

I'm pretty sure CouchDB does return id alongside errors so hopefully this is straightforward.

@willholley willholley added a commit that referenced this issue Dec 21, 2016
@willholley willholley (#6039) - include id in all bulk_docs results
CouchDB already includes an id field for each result in a _bulk_docs
response. For non-http adapters, ensure we do the same.

It seems simpler to do this in the core adapter code rather than patch
up every individual storage engine.
bbef5ce
@willholley willholley added a commit to willholley/pouchdb that referenced this issue Dec 21, 2016
@willholley willholley (#6039) - include id in all bulk_docs results
CouchDB already includes an id field for each result in a _bulk_docs
response. For non-http adapters, ensure we do the same.

It seems simpler to do this in the core adapter code rather than patch
up every individual storage engine.
2de6654
@willholley willholley added a commit that referenced this issue Dec 22, 2016
@willholley willholley (#6039) - include id in all bulk_docs results (#6047)
CouchDB already includes an id field for each result in a _bulk_docs response. For non-http adapters, ensure we do the same.

It seems simpler to do this in the core adapter code rather than patch up every individual storage engine.
2553fd7
@nolanlawson nolanlawson added a commit that referenced this issue Dec 23, 2016
@nolanlawson nolanlawson (#6039) - fix ids included in bulkDocs() responses
This reverts commit 095a9a2 and fixes #6039.
07143d9
@daleharvey daleharvey added a commit that referenced this issue Dec 26, 2016
@nolanlawson @daleharvey nolanlawson + daleharvey (#6039) - fix ids included in bulkDocs() responses
This reverts commit 095a9a2 and fixes #6039.
63f039c
@daleharvey daleharvey added a commit that closed this issue Dec 26, 2016
@nolanlawson @daleharvey nolanlawson + daleharvey (#6039) - fix ids included in bulkDocs() responses
This reverts commit 095a9a2 and fixes #6039.
63f039c
@nolanlawson
Member

@willholley Yep it does, the new test confirms same behavior between Couch and Pouch modulo some weirdo subtle differences that we may want to fix (e.g. ok: true even for errors, error: "conflict" instead of error: true).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment