Repository navigation
fix(indexeddb): use 0-N revisions for local documents - #9293
Closed
superbot-helper wants to merge 1 commit into
Closed
superbot-helper wants to merge 1 commit into
superbot-helper wants to merge 1 commit into
Conversation
Local documents (_local/*) written through the indexeddb adapter were given ordinary versioned revisions (1-<hash>, 2-<hash>). The adapter defines _getLocal but not _putLocal/_removeLocal, so pouchdb-core falls through to the generic write path, and parseDoc starts new documents at generation 1. CouchDB and the leveldb-core, websql-core and idb adapters all use the 0-N local-document scheme. Add putLocal/removeLocal to the adapter and route local documents in bulkDocs through them, so put() and bulkDocs() agree. Local revisions written by earlier releases (1-<hash>) carry their generation over on the next write, so the revision stays monotonic. Low severity: within the adapter local documents already read back what was written; only the revision value violated the contract.
Author
|
Withdrawing this. The defect is real, so leaving the finding on the record for whoever picks it up:
Measured on 9.0.0: Sorry for the noise. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local documents (_local/*) written through the indexeddb adapter were given ordinary versioned revisions (1-, 2-).
The adapter defines _getLocal but not _putLocal/_removeLocal, so pouchdb-core falls through to the generic write path, and parseDoc starts new documents at generation 1. CouchDB and the leveldb-core, websql-core and idb adapters all use the 0-N local-document scheme.
Add putLocal/removeLocal to the adapter and route local documents in bulkDocs through them, so put() and bulkDocs() agree. Local revisions written by earlier releases (1-) carry their generation over on the next write, so the revision stays monotonic.
Low severity: within the adapter local documents already read back what was written; only the revision value violated the contract.
Overview
Testing recommendations
Related Issues or Pull Requests
Checklist
docsfolder