-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
chore(#9534): upgrade PouchDB to version 9 #9550
base: master
Are you sure you want to change the base?
Conversation
@@ -234,8 +234,14 @@ describe('Db Service', () => { | |||
}); | |||
|
|||
describe('method wrapping', () => { | |||
let testDB; | |||
let syncTarget; | |||
|
|||
beforeEach(() => { | |||
window.PouchDB = require('pouchdb-browser').default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these functions from L251 (bulkGet, get, allDocs, etc) aren't located in window.PouchDB.prototype
. The PouchInternal's constructor calls _setup()
to add all those functions to a DB instance.
To make these tests work, we create an instance and make window.PouchDB
return it, so later we stub its functions.
tests/scalability/replicate-real-world-docs/add-docs-to-remote.js
Outdated
Show resolved
Hide resolved
tests/scalability/replicate-real-world-docs/add-docs-to-remote.js
Outdated
Show resolved
Hide resolved
await target.bulkDocs([{ _id: uuidv4() }]); | ||
sinon.stub(target, 'allDocs').rejects({ status: 400, name: 'forbidden' }); | ||
await syncTarget.bulkDocs([{ _id: uuidv4() }]); | ||
sinon.stub(syncTarget, 'bulkGet').rejects({ status: 400, name: 'forbidden' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, did the internal sync implementation change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to check the sync implementation (node-modules) because it wasn't breaking with rejection from allDocs
, but bulkGet
breaks it. I need to research more
Description
This work won't be continued. I'm leaving the PR open for now, as it might be easier to find and serve as a reference.
#9534
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.