Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a view filter during a replication doesn't work #37

Open
mikeymckay opened this issue Jun 23, 2016 · 6 comments
Open

Using a view filter during a replication doesn't work #37

mikeymckay opened this issue Jun 23, 2016 · 6 comments

Comments

@mikeymckay
Copy link
Contributor

If I try and do a replication from a pouchdb with crypto-pouch applied it works fine. But when I then use the option:
{filter:"_view",view:"results"} // results is a view
no documents are transferred.
If I replicate the encrypted db to an unencrypted db, and then do the same replication from the unencrypted db it works fine.

@calvinmetcalf
Copy link
Owner

so there is likely 1 of 2 issues here either

  1. transform-pouch isn't passing the docs through decrypt before they go to the filter function
  2. transform-pouch or us isn't decrypting the design doc before we try to filter it

can you try again but passing a function to the filter instead of a design doc ?

@mikeymckay
Copy link
Contributor Author

If I pass in a filter function it works fine:

p.replicate.to(t,{filter: function(doc){return doc.collection === 'result'}}).catch(function(error){console.log(error)}).then(function(res){console.log(res)})

-> Object {ok: true, start_time: Thu Jun 23 2016 15:47:49 GMT+0300 (EAT), docs_read: 2, docs_written: 2, doc_write_failures: 0…}

@calvinmetcalf
Copy link
Owner

are either of the dbs http dbs or are they all local ones ?

@mikeymckay
Copy link
Contributor Author

I've tried replicating to both local and to an external couch with the same
result.
On Jun 23, 2016 18:41, "Calvin Metcalf" [email protected] wrote:

are either of the dbs http dbs or are they all local ones ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#37 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAAu74ev844Z3PILU99sWOOC1QZf6X4sks5qOqkPgaJpZM4I8vsH
.

@rjcorwin
Copy link

I'm seeing this issue also when using Mango queries to filter replication. A work around that might work for some projects is to create a temporary database without crypto enabled, doing a full replication to that, doing the filtered replication between the temporary database and the target database, then destroying the temporary database. However even after the temporary database is destroyed, an attacker might be able to recover it.

@garbados
Copy link
Collaborator

garbados commented Aug 6, 2021

Hi folks! We just published version 4.0 which includes a significant refactor and many different dependencies. Could you try this again and let me know how it goes? I can help you debug from there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants