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

test: reproduce 412 pouchdb error #4107

Closed
wants to merge 2 commits into from
Closed

Conversation

Elendiar
Copy link

@Elendiar Elendiar commented Nov 3, 2022

This PR contains:

  • TEST that reproduced a bug

Describe the problem you have without this PR

(https://github.com/pubkey/rxdb/discussions/4106)

I started test:browser with "--single-run=false --auto-watch" and checked IndexedDB in debug manually to make sure sure of different digest.

@pubkey
Copy link
Owner

pubkey commented Nov 3, 2022

RxError (DB9): RxError (DB9):
createRxDatabase(): Adapter not added. Use addPouchPlugin(require('pouchdb-adapter-[adaptername]'));
Given parameters: {
adapter:"idb"}

Please check.

Also pls try to reproduce this with a smaller attachment so that I can use that in the unit tests without add a such long base64 string.

@Elendiar
Copy link
Author

Elendiar commented Nov 4, 2022

RxError (DB9): RxError (DB9):
createRxDatabase(): Adapter not added. Use addPouchPlugin(require('pouchdb-adapter-[adaptername]'));
Given parameters: {
adapter:"idb"}

Please check.

Also pls try to reproduce this with a smaller attachment so that I can use that in the unit tests without add a such long base64 string.

Fix this and changed base64string.

@pubkey
Copy link
Owner

pubkey commented Nov 6, 2022

Thanks,
I double checked, it is not working as it should. PouchDB does not create the same hash as RxDB's md5 hashing which is used for attachments.

@pubkey
Copy link
Owner

pubkey commented Nov 6, 2022

I decided to refactor how the attachment hashing works.
In the future it should hash inside of the RxStorage, not from the outside by RxDB itself.
This will make the behavior equal to CouchDB: pouchdb/pouchdb#3156 (comment)

Branch: #4115

pubkey added a commit that referenced this pull request Nov 7, 2022
@pubkey
Copy link
Owner

pubkey commented Nov 7, 2022

Fixed here: #4115

@pubkey pubkey closed this Nov 7, 2022
pubkey added a commit that referenced this pull request Nov 7, 2022
* REFACTOR attachment hashing

* FIX tests

* FIX only write attachment data if it has changed

* FIX circular import

* FIX import

* UPDATE docs

* FIX import

* ADD comment

* FIX #4107

* FIX format

* IMPROVE lint performance

* ADD changelog

* IMPROVE lint performance
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

Successfully merging this pull request may close these issues.

None yet

2 participants