couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [couchdb-fauxton] branch master updated: (#880) - filter out all design docs for replication activity
Date Wed, 22 Mar 2017 12:59:09 GMT
This is an automated email from the ASF dual-hosted git repository.

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

The following commit(s) were added to refs/heads/master by this push:
       new  844fad2   (#880) - filter out all design docs for replication activity
844fad2 is described below

commit 844fad2fbb1851a9b84d4f220f8629e6ff407e89
Author: garren smith <garren.smith@gmail.com>
AuthorDate: Wed Mar 22 14:59:07 2017 +0200

    (#880) - filter out all design docs for replication activity
---
 app/addons/replication/__tests__/actions.test.js |  2 +-
 app/addons/replication/__tests__/api.tests.js    | 16 +++++++++++++++-
 app/addons/replication/api.js                    |  2 +-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/app/addons/replication/__tests__/actions.test.js b/app/addons/replication/__tests__/actions.test.js
index 804aa6b..b99c94e 100644
--- a/app/addons/replication/__tests__/actions.test.js
+++ b/app/addons/replication/__tests__/actions.test.js
@@ -164,7 +164,7 @@ describe("Replication Actions", () => {
         }
       ];
 
-      fetchMock.getOnce('/_scheduler/job', 404);
+      fetchMock.getOnce('/_scheduler/jobs', 404);
       fetchMock.getOnce('/_replicator/_all_docs?include_docs=true&limit=100', {rows:
[]});
       fetchMock.postOnce('/_replicator/_bulk_docs', {
         status: 200,
diff --git a/app/addons/replication/__tests__/api.tests.js b/app/addons/replication/__tests__/api.tests.js
index 54721c2..d1c4c76 100644
--- a/app/addons/replication/__tests__/api.tests.js
+++ b/app/addons/replication/__tests__/api.tests.js
@@ -344,6 +344,20 @@ describe('Replication API', () => {
             "validate_doc_update":"\n    function(newDoc, oldDoc, userCtx) {\n        function
reportError(error_msg) {\n            log('Error writing document `' + newDoc._id +\n    
           '\\' to the replicator database: ' + error_msg);\n            throw({forbidden:
error_msg});\n        }\n\n        function validateEndpoint(endpoint, fieldName) {\n    
       if ((typeof endpoint !== 'string') &&\n                ((typeof endpoint !==
'object') || (endpoint === null))) {\n\n   [...]
           }
         },
+          {
+            "id":"_design/filters",
+            "key":"_design/filters",
+            "value":{
+              "rev":"1-1390740c4877979dbe8998382876556c"
+            },
+            "doc":{
+              "_id":"_design/filters",
+              "_rev":"1-1390740c4877979dbe8998382876556c",
+              "filters": {
+                "afilter": "\n function (doc, req) { if (doc.type === 'a-doc') { return true;
} \n return false }"
+              }
+            }
+        },
         {
           "id":"c94d4839d1897105cb75e1251e0003ea",
           "key":"c94d4839d1897105cb75e1251e0003ea",
@@ -413,7 +427,7 @@ describe('Replication API', () => {
         fetchMock.restore();
       });
 
-      it("returns parsedReplicationDocs", () => {
+      it("returns parsedReplicationDocs and ignores all design docs", () => {
         fetchMock.getOnce('/_scheduler/jobs', 404);
         fetchMock.get('/_replicator/_all_docs?include_docs=true&limit=100', _repDocs);
         return supportNewApi(true)
diff --git a/app/addons/replication/api.js b/app/addons/replication/api.js
index 6f29423..b0f08ba 100644
--- a/app/addons/replication/api.js
+++ b/app/addons/replication/api.js
@@ -305,7 +305,7 @@ export const fetchReplicationDocs = () => {
         return [];
       }
 
-      return parseReplicationDocs(res.rows.filter(row => row.id.indexOf("_design/_replicator")
=== -1));
+      return parseReplicationDocs(res.rows.filter(row => row.id.indexOf("_design/") ===
-1));
     });
 
     if (!newApi) {

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

Mime
View raw message