You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2017/08/03 22:07:21 UTC

[couchdb] branch master updated: Allow replicator application to always update replicator docs

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ba4208  Allow replicator application to always update replicator docs
1ba4208 is described below

commit 1ba42081779dfea2d4d09af00744ab4667ffd941
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Thu Aug 3 17:42:24 2017 -0400

    Allow replicator application to always update replicator docs
    
    Previously when updating the document with the error or failed states
    the document body will not pass the validation function and will
    consequently crash either the scheduler or the doc processor.
---
 src/couch_replicator/src/couch_replicator_js_functions.hrl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/couch_replicator/src/couch_replicator_js_functions.hrl b/src/couch_replicator/src/couch_replicator_js_functions.hrl
index 9b11e8a..d410433 100644
--- a/src/couch_replicator/src/couch_replicator_js_functions.hrl
+++ b/src/couch_replicator/src/couch_replicator_js_functions.hrl
@@ -53,6 +53,11 @@
         var isReplicator = (userCtx.roles.indexOf('_replicator') >= 0);
         var isAdmin = (userCtx.roles.indexOf('_admin') >= 0);
 
+        if (isReplicator) {
+            // Always let replicator update the replication document
+            return;
+        }
+
         if (newDoc._replication_state === 'failed') {
             // Skip validation in case when we update the document with the
             // failed state. In this case it might be malformed. However,

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].