You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(config): a missing seed YAML must not start setup over live Settings #1153
A missing leftover config.yaml starts the setup wizard even when state.db already holds Settings. Finishing the wizard can commit that new YAML over live configuration.
Found on master 6eadec3f (schema 2: settings live in SQLite; YAML is a locator and rollback seed).
isConfigMissing is only Lstat of the seed path. It does not look for state.db or settings/config_v1.
The wizard writes a new YAML. InitializeStorage then sees an existing settings row whose YAMLSourceHash does not match the new file, sets legacySave, and saveStored commits the wizard document over the live Settings (go/internal/config/storage.go).
The same legacySave path fires if the leftover seed is edited or config_database is removed: YAML becomes authority again.
TestMissingDatabaseDoesNotStartSetup only covers the inverse (locator present, DB gone).
What a fix needs
If state.db already has settings/config_v1, do not enter the wizard because the seed file is missing. Recreate the locator YAML from SQLite instead.
Refuse legacySave when the new YAML is a wizard/default document rather than an old-Core rollback save.
Tests: delete config.yaml, keep state.db with Settings, start Core — Settings unchanged, locator rewritten, wizard not shown.
Same for an edited leftover seed.
This is a data-loss path on every schema-2 box that still has a seed file beside the DB (the documented layout).
Activity
fix(config): do not start setup over live Settings (#1175)