You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/01/15 11:47:30 UTC

[GitHub] [couchdb] nicolas-albert opened a new issue #3328: Incorrect multipart/related response in case of _bulk_get with attachments and atts_since

nicolas-albert opened a new issue #3328:
URL: https://github.com/apache/couchdb/issues/3328


   ## Description
   
   The _bulk_get service allows to retrieve multiple documents with their attachments. If the client already have a revision of a document, the atts_since option allows to not reply an unmodified attachment again.
   
   In this case, the part is incorrect:
   ```
   ----68dd74e8c5bb2822e23a8ada6eeb2619
   X-Doc-Id: att_10
   X-Rev-Id: 3-a50b011b678507001e15d904295bccf1
   Content-Type: multipart/related; boundary=--c994d3e17aee82de2d947e57171e97ad
   
   {"_id":"att_10","_rev":"3-a50b011b678507001e15d904295bccf1","data":"data_10","_revisions":{"start":3,"ids":["a50b011b678507001e15d904295bccf1","3d2ba9b990fa62a3aeabc75f86aaace8","167072636fface8c96ec4eb1cb915814"]},"_attachments":{"text.txt":{"content_type":"text/plain","revpos":2,"digest":"md5-VviK0JqDf+w9vDhCLZSI5Q==","length":11,"stub":true,"encoding":"gzip","encoded_length":31}}}
   ----68dd74e8c5bb2822e23a8ada6eeb2619
   ```
   The part declares a sub multipart/related with a boundary never used and the application/json Content-Type isn't set.
   The couchbaselite-java (1.4.x) library break the replication because of this nonsense.
   
   ## Steps to Reproduce
   
   Take a document with an attachment, note its revision and make a new revision:
   `curl -H "Accept: multipart/related" -H "Content-Type: application/json" -d '{"docs":[{"atts_since":["x-oldrev"],"rev":"y-newrev","id":"mydoc"}]}' "http://localhost:5984/mydb/_bulk_get?revs=true&attachments=true"`
   
   Should also works with multiple docs for the same query.
   
   ## Expected Behaviour
   
   Instead, we should have something like this:
   ```
   ----68dd74e8c5bb2822e23a8ada6eeb2619
   X-Doc-Id: att_10
   X-Rev-Id: 3-a50b011b678507001e15d904295bccf1
   Content-Type: multipart/related; boundary=--c994d3e17aee82de2d947e57171e97ad
   
   ----c994d3e17aee82de2d947e57171e97ad
   Content-Type: application/json
   
   {"_id":"att_10","_rev":"3-a50b011b678507001e15d904295bccf1","data":"data_10","_revisions":{"start":3,"ids":["a50b011b678507001e15d904295bccf1","3d2ba9b990fa62a3aeabc75f86aaace8","167072636fface8c96ec4eb1cb915814"]},"_attachments":{"text.txt":{"content_type":"text/plain","revpos":2,"digest":"md5-VviK0JqDf+w9vDhCLZSI5Q==","length":11,"stub":true,"encoding":"gzip","encoded_length":31}}}
   ----c994d3e17aee82de2d947e57171e97ad--
   ----68dd74e8c5bb2822e23a8ada6eeb2619
   ```
   
   ## Your Environment
   
   * CouchDB version used: tested with CouchDB 2.3.1 and 3.1.1
   * Operating system and version: docker versions
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva commented on issue #3328: Incorrect multipart/related response in case of _bulk_get with attachments and atts_since

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #3328:
URL: https://github.com/apache/couchdb/issues/3328#issuecomment-761111871


   That looks like a bug. Thank you for your report @nicolas-albert 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org