Skip to content

Release 1.40.3: migrate C-Gate projects that 3.8.0 refuses to load - #177

Merged
cursor[bot] merged 2 commits into
masterfrom
dougrathbone/cgate-schema-migrate-5394
Nov 13, 2026
Merged

cursor[bot] merged 2 commits into
masterfrom
dougrathbone/cgate-schema-migrate-5394

Conversation

@dougrathbone

Copy link
Copy Markdown
Owner

Summary

Fixes the remaining part of #174. 1.40.2 set CGATE_APPDATA, which stops config commands hanging. A project last written by C-Gate 3.3.x still will not load on 3.8.0: project load returns a schema version error (schema 13, must be 14) and the project never starts, so every bridge command fails with network not found.

After the managed command port is up, and only when that project is stopped or missing, the add-on sends project load. If the response is that schema error, it copies the database to <project>.db.before-schema-migrate (and will not overwrite an existing copy), runs transform migrate_sql, then load, use and start.

A project that is already started, still loading, or already loaded is not touched. Any other load failure is not a migration. A query failure or a failed migration does not stop the bridge from starting.

Testing

  • npm test (3401), npm run lint and npm run typecheck pass.
  • npm run validate:changelog and npm run validate:addon-config pass.
  • The new script tests cover remote mode, an already-started project, a project still loading, the schema error (commands and the backup copy), a different 408, a failed migration that must keep the first copy, a missing database file, an unsafe project name, and C-Gate not answering.

Not run against a real C-Gate 3.8.0. The command sequence is the one reported to fix a live 3.3.2 to 3.8.0 upgrade. The sample project database in the repo is schema 13, which is the version 3.8.0 rejects, but the integration legs still install 3.3.x and that database loads there without this path.

No tag has been pushed. After merge, git tag v1.40.3 && git push origin v1.40.3 publishes the add-on.

Open in Web Open in Cursor 

cursoragent and others added 2 commits November 13, 2026 23:27
C-Gate 3.8.0 rejects a project last written by 3.3.x with a schema
version error and then never starts it, so every bridge command fails
with network not found. When the managed project is stopped or missing
and project load returns that specific error, run transform migrate_sql
and then load, use and start the project.

Copy the database beside itself first, and do not overwrite that copy
on a later attempt. A project that is already started, still loading,
or failing for any other reason is left alone, and a migration problem
does not stop the bridge from starting.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
@cursor
cursor Bot merged commit 237700c into master Nov 13, 2026
27 checks passed
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.

2 participants