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
base: master
Are you sure you want to change the base?
Conversation
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) { |
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.
Would this have the same effect as:
metaStore.get(META_STORE).onsuccess = function (e) {
metadata.seq = e.target.result.seq;
...
}
?
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 will have to spend some time analyzing it. It's been too long for me to remember the technical details.
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.