Repository navigation
fix(database): support upstream schema 27 for sync restore (#576) - #578
Merged
SaladDay merged 2 commits intoNov 24, 2026
Merged
Conversation
) Desktop v4.0.36-v4.0.40 write schema 27, but the CLI only supported up to schema 26, so WebDAV/S3 restore rejected the snapshot with "Remote database schema is too new (27); this app supports up to 26". Align the fresh-table DDL and add a 26->27 migration for the upstream GitLab skill repository columns (skill_repos.host with default 'github.com', skills.repo_host nullable), idempotent and tolerant of absent tables. Switch save_skill_repo to an explicit upsert so it only writes the CLI-managed columns and no longer resets host back to github.com on a load_index -> save_index round-trip. Extend fixtures and tests through schema 27 and cover both DAO write paths and the sync round-trip. Document in both CHANGELOGs. Adds database compatibility only, not GitLab skill repository management. Databases newer than schema 27 are still rejected. Co-authored-by: NorthSecond <NorthSecond@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The CLI only talks to GitHub. Hide non-GitHub skill repos synced from desktop (schema 27 host) and skip/refuse updates for skills installed from them, so they are never fetched from github.com. Also correct the desktop version range to v4.0.34-v4.0.40.
Owner
|
Thanks for the fix! I pushed a small follow-up so the CLI leaves GitLab repos alone, and it's merged now. |
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.
Summary
Adds upstream schema 27 (CC Switch desktop v4.0.36–v4.0.40) to the CLI's accepted range, following the same pattern used to adopt schemas 21–26. Fixes
Remote database schema is too new (27); this app supports up to 26when restoring WebDAV/S3 snapshots from recent desktop releases. Addresses #576.The upstream change is two columns on the skill-repository tables:
The CLI has no GitLab skill-repo management, so it only aligns the columns and keeps upstream-owned values intact:
save_skill_reposwitched fromINSERT OR REPLACEto an explicitON CONFLICT(owner, name) DO UPDATE, so aload_index → save_indexround-trip no longer resets a synced GitLab repo'shostback togithub.com.save_skillalready lists explicit columns, sorepo_hostis untouched.PRAGMA table_info, so both columns flow through snapshots automatically.Evidence
Before:
import_sql_string_for_syncon auser_version = 27snapshot fails invalidate_sql_user_version_for_importwithRemote database schema is too new (27).After: the snapshot validates and restores.
cargo test --lib --no-default-features -- database::tests sync_protocol webdav_sync→106 passed; 0 failed, including new cases:schema_migration_upstream_v18_through_v27_preserves_data_and_is_idempotentinit_and_sync_import_accept_upstream_v18_through_v27skill_dao_save_preserves_upstream_repo_host/skill_repo_save_preserves_upstream_hostschema_create_tables_matches_upstream_v27_flagscargo fmt --checkclean;cargo check --lib --no-default-featuresclean (only pre-existing warnings in unrelated files).Merge Danger
Door: two-way
Rollback is a revert; the added columns are inert defaults (
github.com/ NULL) for the CLI and older code ignores them. Note: after a device migrates to schema 27, CLI ≤ v5.11.4 can no longer open that database (documented in CHANGELOG upgrade notes).Blast Radius: sync restore
Touches schema versioning, fresh-table DDL, one migration step, one DAO write path, and test fixtures. No behaviour change for users already at ≤ 26; databases newer than 27 are still rejected.
Notes
Database compatibility only — no GitLab skill-repository management is added. Upstream's unreleased schema 28 is intentionally out of scope.