Skip to content

Conversation

@danlaine
Copy link
Collaborator

@danlaine danlaine commented Jan 8, 2026

With this change, all qmdb::any databases all support state sync.

  • The unordered variants already had state sync. storage/src/qmdb/any/unordered/fixed/sync.rs and storage/src/qmdb/any/unordered/fixed/sync.rs have been deleted, as their contents have been factored out.
  • Changes Error type of journal::contiguous::fixed::Journal::init_sync from crate::qmdb::Error to Error. I think returning an error from the same crate the method's in makes more sense.
  • Increases visibility of some mod tests to share helper code.
  • Adds macro to generate Resolver implementations for each database variant.

@danlaine danlaine self-assigned this Jan 8, 2026
@danlaine danlaine added this to Tracker Jan 8, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 8, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp 124eb30 Jan 23 2026, 02:17 AM

@danlaine danlaine moved this to In Progress in Tracker Jan 8, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 8, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

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

View logs

@@ -0,0 +1,220 @@
//! An authenticated database that provides succinct proofs of _any_ value ever associated
Copy link
Collaborator Author

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

@danlaine danlaine force-pushed the danlaine/sync-ordered branch from 39044bc to 3f63d0b Compare January 22, 2026 03:53
@danlaine danlaine changed the title [Storage] Add state sync for qmdb::any::ordered [Storage] Factor out qmdb::any state sync Jan 22, 2026
@danlaine danlaine marked this pull request as ready for review January 22, 2026 19:57
@danlaine danlaine changed the title [Storage] Factor out qmdb::any state sync [Storage] Factor out qmdb::any state sync; implement for qmdb::any::ordered::* Jan 22, 2026
@danlaine danlaine moved this from In Progress to Ready for Review in Tracker Jan 22, 2026
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a 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() {
Copy link

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)

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 96.60441% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.26%. Comparing base (5ea0f6e) to head (124eb30).

Files with missing lines Patch % Lines
storage/src/qmdb/sync/resolver.rs 65.85% 14 Missing ⚠️
storage/src/qmdb/any/ordered/variable.rs 97.22% 2 Missing ⚠️
storage/src/qmdb/any/unordered/variable.rs 95.83% 2 Missing ⚠️
storage/src/journal/contiguous/fixed.rs 75.00% 1 Missing ⚠️
storage/src/qmdb/sync/journal.rs 95.83% 1 Missing ⚠️
@@            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     
Files with missing lines Coverage Δ
storage/src/journal/contiguous/variable.rs 98.12% <100.00%> (-0.01%) ⬇️
storage/src/qmdb/any/mod.rs 100.00% <ø> (ø)
storage/src/qmdb/any/ordered/fixed.rs 99.56% <100.00%> (+<0.01%) ⬆️
storage/src/qmdb/any/sync/mod.rs 100.00% <100.00%> (ø)
storage/src/qmdb/any/sync/tests.rs 99.16% <100.00%> (ø)
storage/src/qmdb/any/unordered/fixed.rs 95.04% <ø> (ø)
storage/src/qmdb/any/unordered/mod.rs 98.63% <100.00%> (ø)
storage/src/qmdb/immutable/mod.rs 85.57% <100.00%> (-1.13%) ⬇️
storage/src/qmdb/immutable/sync.rs 98.28% <100.00%> (ø)
storage/src/qmdb/sync/database.rs 100.00% <100.00%> (ø)
... and 7 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ea0f6e...124eb30. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants