-
Notifications
You must be signed in to change notification settings - Fork 176
[Storage] Factor out qmdb::any state sync; implement for qmdb::any::ordered::*
#2748
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
base: main
Are you sure you want to change the base?
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | 124eb30 | Jan 23 2026, 02:17 AM |
Deploying monorepo with
|
| Latest commit: |
124eb30
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c9294ef8.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://danlaine-sync-ordered.monorepo-eu0.pages.dev |
| @@ -0,0 +1,220 @@ | |||
| //! An authenticated database that provides succinct proofs of _any_ value ever associated | |||
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.
Moved from storage/src/qmdb/any/ordered/variable.rs
39044bc to
3f63d0b
Compare
qmdb::any::orderedqmdb::any state sync
qmdb::any state syncqmdb::any state sync; implement for qmdb::any::ordered::*
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| /// Create a new sync engine with the given configuration | ||
| pub async fn new(config: Config<DB, R>) -> Result<Self, Error<DB, R>> { | ||
| if config.target.range.is_empty() { | ||
| if config.target.range.is_empty() || !config.target.range.end.is_valid() { |
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.
Incomplete validation allows MAX_LOCATION edge case
Low Severity
The validation checks !range.end.is_valid() which allows range.end == MAX_LOCATION (2^62 - 1), but line 75 of sync/mod.rs computes Position::try_from(range.end + 1). When range.end == MAX_LOCATION, this creates Location(MAX_LOCATION + 1) which fails Position::try_from's is_valid() check, returning LocationOverflow error instead of the clearer InvalidTarget error from validation.
Additional Locations (2)
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #2748 +/- ##
==========================================
+ Coverage 92.25% 92.26% +0.01%
==========================================
Files 382 382
Lines 121713 121513 -200
==========================================
- Hits 112287 112120 -167
+ Misses 9426 9393 -33
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
With this change, all
qmdb::anydatabases all support state sync.storage/src/qmdb/any/unordered/fixed/sync.rsandstorage/src/qmdb/any/unordered/fixed/sync.rshave been deleted, as their contents have been factored out.Errortype ofjournal::contiguous::fixed::Journal::init_syncfromcrate::qmdb::ErrortoError. I think returning an error from the same crate the method's in makes more sense.mod tests to share helper code.Resolverimplementations for each database variant.