garbados / comdb

A PouchDB plugin that transparently encrypts and decrypts its data.
61 stars 4 forks source link

Loading encrypted documents created with `.post()` fails sometimes #21

Closed garbados closed 2 years ago

garbados commented 2 years ago

Encrypted documents created with .post() fail to load using .loadEncrypted() if a version of that document already exists on the decrypted side. You can replicate this issue in a browser by running this code:

const db = new PouchDB('local')
db.setPassword(PASSWORD).then(async () => {
  await db.loadEncrypted()
  await db.post({ name: 'bob' })
})

This will work the first time. But if you run this in a browser and then reload the page, it will fail with a message like this:

garbados commented 2 years ago

Hi @jjtolton ! A fix to your issue has been released in version 5.0.2-beta. Check it out and let me know if anything went wrong!

jjtolton commented 2 years ago

I can’t WAIT to try it ! I’ll get you some feedback soon

On Sun, Apr 24, 2022 at 3:48 PM Diana Thayer @.***> wrote:

Hi @jjtolton https://github.com/jjtolton ! A fix to your issue has been released in version 5.0.2-beta. Check it out and let me know if anything went wrong!

— Reply to this email directly, view it on GitHub https://github.com/garbados/comdb/issues/21#issuecomment-1107906504, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPJX43J5FX7ZSG6IQPLLSLVGWQP7ANCNFSM5UGVBMSQ . You are receiving this because you were mentioned.Message ID: @.***>

jjtolton commented 2 years ago

Works GREAT! Only thing now is you need to get that GH sponsors account open!