redgeoff / delta-pouch

Conflict-free collaborative editing for PouchDB
196 stars 13 forks source link

Doesn't play nice with Pouch Find #175

Open funblaster22 opened 1 year ago

funblaster22 commented 1 year ago

I've been trying to combine Delta pouch with pouch find, and there are a few issues. First, when the search results are returned, it doesn't apply patches. Second, when used in tandem, the first "root" document doesn't have the $id property. I suspect both these issues are caused by pouch find being unaware of delta pouch's custom resolving code, since the way documents are stored in the database is different from how it's presented.

I understand there is a .all method which does this merging, but other Pouchdb plugins aren't aware of it. My proposed solution is to provide a override for the bulkGet or allDocs method that merges the documents together.

Here's a picture illustrating what happens when I try to use delta pouch and search together:

image

I'm looking into a fix and submitting this issue for documentation. If anyone has additional insights, that would be great.

funblaster22 commented 1 year ago

This is waiting on a fix from PouchDB to override preexisting methods in version 8

janzheng commented 1 year ago

This is waiting on a fix from PouchDB to override preexisting methods in version 8

I'm new to Couchbase and Pouchbase, and I was curious — if PouchDB fixed this issue, would that mean your pull request would work on Pouchdb 8? Your contributions are really interesting to a project I'm working on.

Also curious, since this repo seems not maintained anymore — would it make sense for you to fork your PR into a new project and continue from there?

funblaster22 commented 1 year ago

Correct, it should work on CouchDb 8 after the PR is merged. For the time being, using couchDb 7 works the same. The fork I used to create the pull request is located here. If you want to install in your project, use npm i https://github.com/funblaster22/delta-pouch-find.git