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

Attachments get lost when syncing in electron app #264

Closed
scuy opened this issue Sep 22, 2017 · 2 comments
Closed

Attachments get lost when syncing in electron app #264

scuy opened this issue Sep 22, 2017 · 2 comments

Comments

@scuy
Copy link
Contributor

scuy commented Sep 22, 2017

We are developing an electron application and are using express-pouchdb for syncing between clients. However, we have been experiencing the loss of images that we store as attachments after a client pulls changes from another client. Looking at the network tab of the dev console shows that the GET requests for the attachments return 200 with an empty JSON object in the body instead of the actual binary content.

I think I tracked down the error to the getAttachment function which seems to rely on the fact that node Buffers are returned from the corresponding pouchdb adapter. This seems to be a valid assumption in most node environments. However since we are in a hybrid environment we are able to use IndexedDB (syncing does not work for us with the LevelDB adapter). Thus the adapter returns Blobs which do not seem to be handled correctly.

I submitted a pull-request (#263) that fixes our problem. However, I am not sure if this the right place to fix this since I am unaware of the PouchDB internals.

@perlun
Copy link

perlun commented Apr 19, 2018

Fixed in 513c849, this can be closed @scuy @marten-de-vries

@scuy
Copy link
Contributor Author

scuy commented Apr 20, 2018

Thanks a lot!

@scuy scuy closed this as completed Apr 20, 2018
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

2 participants