isValidRev(): reject revs with more than one dash#8933
Merged
SourceR85 merged 1 commit intoapache:masterfrom Apr 15, 2024
Merged
isValidRev(): reject revs with more than one dash#8933SourceR85 merged 1 commit intoapache:masterfrom
SourceR85 merged 1 commit intoapache:masterfrom
Conversation
There are various places in the code where revs are assumed to include a single
dash character:
* pouchdb-adapter-idb/src/index.js:533: doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1);
* pouchdb-adapter-leveldb-core/src/index.js:1402: oldRev ? '0-' + (parseInt(oldRev.split('-')[1], 10) + 1) : '0-1';
* pouchdb-core/src/adapter.js:249: var parts = doc._rev.split('-');
* pouchdb-core/src/adapter.js:599: var splittedRev = doc._rev.split('-');
* pouchdb-core/src/adapter.js:623: const pathId = doc._rev.split('-')[1];
* pouchdb-merge/src/revExists.js:4: var splitRev = rev.split('-');
Follow-up to apache#8931
Contributor
|
I'm curious: Is |
SourceR85
approved these changes
Apr 15, 2024
Contributor
SourceR85
left a comment
There was a problem hiding this comment.
There's room for improvement of checking the hash (e.g. check for illegal characters),
but that's a story for another PR.
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.
There are various places in the code where revs are assumed to include a single dash character:
Follow-up to #8931