Skip to content

Custom sqlite migrator to be cloud-sync-ready#5048

Closed
yujonglee wants to merge 5 commits intomainfrom
custom-sqlite-migrate
Closed

Custom sqlite migrator to be cloud-sync-ready#5048
yujonglee wants to merge 5 commits intomainfrom
custom-sqlite-migrate

Conversation

@yujonglee
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
Signed-off-by: Yujong Lee <yujonglee.dev@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 15, 2026

Deploy Preview for char-cli-web canceled.

Name Link
🔨 Latest commit 6aaa426
🔍 Latest deploy log https://app.netlify.com/projects/char-cli-web/deploys/69df009edecb4a0008ac7191

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 15, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 6aaa426
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69df009e6b4ea80008b60431

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 15, 2026

Deploy Preview for unsigned-char ready!

Name Link
🔨 Latest commit 6aaa426
🔍 Latest deploy log https://app.netlify.com/projects/unsigned-char/deploys/69df009e0981a0000827c87f
😎 Deploy Preview https://deploy-preview-5048--unsigned-char.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@yujonglee yujonglee closed this Apr 15, 2026
Copy link
Copy Markdown

@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 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6aaa426. Configure here.

{
hypr_db_core2::recreate_storage(&options.db)?;
try_open_db(options, schema).await
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recreate policy catches all errors, not just migrations

Medium Severity

The Err(_error) wildcard in open_db catches every AppDbOpenError variant when Recreate policy is active, not just migration failures. The previous open_with_migrate in db-core2 specifically matched only DbOpenError::Migration. Now errors like StepChecksumMismatch, Open (connection/IO failures), InvalidCloudsyncStep, or transient Sqlx errors would all trigger recreate_storage, silently wiping the database. This is a data-loss risk for any future caller that opts into the Recreate policy.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6aaa426. Configure here.

let pool = db.pool().as_ref().clone();

(dir, pool, DbRuntime::new(std::sync::Arc::new(db)))
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests reference tables missing from new migrations

High Severity

setup_runtime() uses hypr_db_app::schema() which only creates templates, calendars, and events tables. However, nearly every test in runtime.rs (both the integration test and the unit test inside src/runtime.rs) references daily_notes and daily_summaries tables, which no longer exist in the migration steps. All those tests will fail at runtime with "no such table" errors.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6aaa426. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant