You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Nolan Lawson (JIRA)" <ji...@apache.org> on 2015/05/25 00:35:17 UTC

[jira] [Created] (COUCHDB-2700) multipart/related parsing broken when attachment contents change

Nolan Lawson created COUCHDB-2700:
-------------------------------------

             Summary: multipart/related parsing broken when attachment contents change
                 Key: COUCHDB-2700
                 URL: https://issues.apache.org/jira/browse/COUCHDB-2700
             Project: CouchDB
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: Database Core
            Reporter: Nolan Lawson


I can reliably reproduce a bug whereby CouchDB 1.6.1 throws this error:

{code:javascript}
{"status":400,"name":"content_md5_mismatch","message":"Missing JSON list of 'docs'"}
{code}

Unfortunately this is a really complicated test case, so it's prohibitively time-consuming for me to turn it into a set of CURL requests. Instead I've made a branch in the PouchDB codebase to reproduce this.

Steps:

{code}
git clone https://github.com/pouchdb/pouchdb.git --depth 1 --branch 3871-repro-for-couchdb
cd pouchdb
npm install
npm run dev
{code}

Once the dev server is running (takes a few seconds to start), open the following URL in Chrome:

{code}
http://localhost:8000/tests/integration/?grep=test.attachments.js-%20local%3Ahttp%20replication%20with%20changing%20attachments
{code}

You can see the PouchDB unit test itself [here](https://github.com/pouchdb/pouchdb/blob/3871-repro-for-couchdb/tests/integration/test.attachments.js#L2215-L2267). It basically replicates a document between two databases several times, while changing the contents of the attachment (but keeping the attachment filename). Note that this test passes against PouchDB Server, where we are using [node-multiparty](https://www.npmjs.com/package/multiparty) for multipart parsing.

In case it helps, I suspect the multipart parsing issue may also be related to a point [~isaacs] raised [in the npm fullfat repo | https://github.com/npm/npm-fullfat-registry/blob/2305c019740a7fd2f60fa1622842d6522a721b77/fullfat.js#L388-L390].

Please also give me any insights into how to write a workaround for CouchDB 1.6, because I would still like to implement multipart support for older versions of CouchDB.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)