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

chore(#9534): upgrade PouchDB to version 9 #9550

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

latin-panda
Copy link
Contributor

@latin-panda latin-panda commented Oct 16, 2024

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

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

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.

@latin-panda latin-panda changed the title chore(9534): upgrade PouchDB to version 9 chore(#9534): upgrade PouchDB to version 9 Oct 16, 2024
@@ -234,8 +234,14 @@ describe('Db Service', () => {
});

describe('method wrapping', () => {
let testDB;
let syncTarget;

beforeEach(() => {
window.PouchDB = require('pouchdb-browser').default;
Copy link
Contributor Author

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/initial-replication.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' });
Copy link
Member

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?

Copy link
Contributor Author

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

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.

3 participants