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

(#8494) - Refreshes seq before indexeddb bulkDocs #8495

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

filionf
Copy link
Contributor

@filionf filionf commented Apr 25, 2022

There is not unit test yet. I would need some guidance on where to create those, and perhaps how to create a multi-page scenario as well.

@broerse
Copy link
Contributor

broerse commented Mar 20, 2023

We need this fix to get PouchDB with this new adapter working in multiple browser tabs.

@@ -314,6 +314,17 @@ export default function (api, req, opts, metadata, dbOpts, idbChanges, callback)
};
}

function refreshMetadataSeq() {
return new Promise(function (resolve) {
txn.objectStore(DOC_STORE).index('seq').openCursor(null, 'prev').onsuccess = function (evt) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this have the same effect as:

metaStore.get(META_STORE).onsuccess = function (e) {
  metadata.seq = e.target.result.seq;
  ...
}

?

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 will have to spend some time analyzing it. It's been too long for me to remember the technical details.

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

3 participants