Skip to content

Lite: an older app stops collecting for 13 tables on a newer data file, and a failed schema step is stamped as done #4727

Closed

Description

@erikdarlingdata

Two problems in how Lite's DuckDbInitializer handles the data file's schema version. Line numbers are as of 1248a67.

1. No guard for a data file newer than the app

Lite/Database/DuckDbInitializer.cs:792,808-811 has no branch for a schema version newer than the app's. An older Lite (after a rollback, or an older portable copy) opens the shared data root (App.xaml.cs:470-488). Schema versions 60 to 65 added columns to 13 tables. So every batch for those tables fails, and the only sign is a line in the log.

Expected: Lite refuses to open a data file stamped with a newer schema version, with a message that names both versions. A read-only open is not enough, because the collectors still fail. The message follows Lite's existing startup error pattern.

Test that must fail first: a data file stamped one version above the app's is refused, and nothing is written to it.

2. Versions 60 to 65 are stamped even when an ALTER failed

DuckDbInitializer.cs:2045-2356. When an ALTER in one of these steps fails, the version is stamped anyway. The step never runs again, so that table's batches keep failing. The trigger is a transient fault during the one start that runs the step.

Expected: stamp the version only when every ALTER in the step succeeded, or re-run the idempotent ALTERs on each start.

Test that must fail first: a step with one failing ALTER leaves the version unstamped, and the next start completes it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions