You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/02/02 09:18:34 UTC
[jira] [Commented] (COUCHDB-2518) CouchDB 2.0 does not support
conflicts=true on /_changes
[ https://issues.apache.org/jira/browse/COUCHDB-2518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14300991#comment-14300991 ]
ASF GitHub Bot commented on COUCHDB-2518:
-----------------------------------------
GitHub user willholley opened a pull request:
https://github.com/apache/couchdb-fabric/pull/11
Respect conflicts=true when collecting clustered changes
This looks to be a relatively straightforward fix. Previously we attempted to look for a conflicts property in Options which was never set (so always evaluated to false). In this PR I've changed changes_enumerator/2 so that it uses the conflicts field from #changes_args which is populated correctly from the query parameters.
Fixes COUCHDB-2518
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/willholley/couchdb-fabric 2518-support-conflicts-param-for-changes
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fabric/pull/11.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11
----
commit 6359f93d6647509d5fc10c28af4afbdbdea89fcf
Author: Will Holley <wi...@gmail.com>
Date: 2015-02-01T21:34:05Z
Respect conflicts=true when collecting clustered changes
This correctly reads the conflicts parameter from #changes_args.
Previously we were attempting to look for a conflicts property in
Options which was never set (so always evaluated to false).
Fixes COUCHDB-2518
----
> 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)