couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glynn Bird (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-2518) CouchDB 2.0 does not support conflicts=true on /_changes
Date Thu, 18 Dec 2014 16:18:13 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-2518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14251860#comment-14251860
] 

Glynn Bird commented on COUCHDB-2518:
-------------------------------------

I've reproduced this on 2.0 Developer Preview. I spotted it because of a failing PouchDB test.


I have a conflicted document, which I can see is conflicted by adding conficts=true:

http://127.0.0.1:15984/testdb/3?conflicts=true

{Code}
{"_id":"3","_rev":"2-ff01552213fafa022e6167113ed01087","value":"Z","_conflicts":["2-aa01552213fafa022e6167113ed01087","1-211c37537c043fcb1c4b4936b843966c"]}
{Code}

But in the changes feed (with conflicts=true) it appears without conflicts

http://127.0.0.1:15984/testdb/_all_docs?conficts=true&include_docs=true

{Code}
{"total_rows":4,"offset":0,"rows":[
{"id":"0","key":"0","value":{"rev":"1-fb8a93eb436b7e799a7bbc578a08e9a5"},"doc":{"_id":"0","_rev":"1-fb8a93eb436b7e799a7bbc578a08e9a5","a":1,"b":1}},
{"id":"1","key":"1","value":{"rev":"1-2b6adfdea4e0fd276a861f663cf984ba"},"doc":{"_id":"1","_rev":"1-2b6adfdea4e0fd276a861f663cf984ba","a":2,"b":4}},
{"id":"2","key":"2","value":{"rev":"1-3a0bf449367880a229ea7c61f9394c83"},"doc":{"_id":"2","_rev":"1-3a0bf449367880a229ea7c61f9394c83","a":3,"b":9}},
{"id":"3","key":"3","value":{"rev":"2-ff01552213fafa022e6167113ed01087"},"doc":{"_id":"3","_rev":"2-ff01552213fafa022e6167113ed01087","value":"Z"}}
]}
{Code}

> CouchDB 2.0 does not support conflicts=true on /_changes
> --------------------------------------------------------
>
>                 Key: COUCHDB-2518
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2518
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Database Core
>            Reporter: Will Holley
>
> CouchDB 1.X supports the conflicts=true query parameter for all API endpints which accept
the include_docs parameter (since version 1.0.3 according to the release notes). This appears
to have regressed in CouchDB 2.0.
> I've observed this in the PouchDB tests (which fail for this). Attempting to reproduce
in curl:
> {code}
> $ curl 'http://127.0.0.1:15984/test' -XPUT
> {"ok":true}
> $ curl 'http://127.0.0.1:15984/test/foo?new_edits=false' -H'Content-Type:application/json'
-XPUT -d'{"_id":"foo","_rev":"2-aa01552213fafa022e6167113ed01087","value":"bar"}'
> {"ok":true,"id":"foo","rev":"2-aa01552213fafa022e6167113ed01087"}
> $ curl 'http://127.0.0.1:15984/test/foo?new_edits=false' -H'Content-Type:application/json'
-XPUT -d'{"_id":"foo","_rev":"3-aa01552213fafa022e6167113ed01087","value":"baz"}'
> {"ok":true,"id":"foo","rev":"3-aa01552213fafa022e6167113ed01087"}
> $ curl 'http://127.0.0.1:15984/test/foo?conflicts=true' | jq .
> {
>   "_id": "foo",
>   "_rev": "3-aa01552213fafa022e6167113ed01087",
>   "value": "baz",
>   "_conflicts": [
>     "2-aa01552213fafa022e6167113ed01087"
>   ]
> }
> $curl 'http://127.0.0.1:15984/test/_changes?include_docs=true&conflicts=true' | jq
.
> {
>   "results": [
>     {
>       "seq": [
>         2,
>         "g1AAAAGpeJzLYWBg4MhgTmHgz8tPSTV0MDQy1zMAQsMcoARTIkOS_P___7MygKxcoAC7kbGFSZKpOU4NSQpAMskeRU9acopJqrExbj0OID3xKHoMDI0MTM2NcOtJAOmpR9GTCrTIMNkQrscITU8eC5BkaABSQG3zszKYE5nA-kyTzFNNLc0xdcFNMsZq0gKISfsRLkg0M7I0ME0h4IIDEH33sxIZCKh8AFH5H6gyCwCZjmsY"
>       ],
>       "id": "foo",
>       "changes": [
>         {
>           "rev": "3-aa01552213fafa022e6167113ed01087"
>         }
>       ],
>       "doc": {
>         "_id": "foo",
>         "_rev": "3-aa01552213fafa022e6167113ed01087",
>         "value": "baz"
>       }
>     }
>   ],
>   "last_seq": [
>     2,
>     "g1AAAAGzeJyFz1EOgjAMBuAFTfTNI-gJzLpRB09yE6VshhDAI-hN9CZ6E73JLJKIGAlZ0jVtvvxpKYSY5xMrFvXROkhAmbXkByUvglTQ0ntf5NxVPJgpHYWEZhDQiitte-aQ2dBpPWySxux6RoKSaNSw2Tfm1DOOgyCDj1E_pp5yFWf-mF0aF7wdknEYdzfpv-7auluXl25ULNGO5N1b9-gcRia0EY24Z-u-7iNMyQEWL83XbI4"
>   ],
>   "pending": 0
> }
> {code}



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

Mime
View raw message