fix(storage): refuse to open a workspace whose database file is missing

With .ykanban present but ykanban.db gone, opening used to create an empty
database and show an empty board without any hint. It now throws
WorkspaceDatabaseMissingException and shows the open-failed page, telling the
user to restore a backup or delete .ykanban and initialize again.
This commit is contained in:
doyaGu committed 2026-10-03 08:12:53 -04:00
1 parent 22102cd1ea
commit c12408d2e3
9 files changed
+65 -3

No files matched your search

@@ -43,6 +43,9 @@ public class OpenFailedPageViewModelTests
Assert.AreEqual(
Expected(Resources.Error_OpenFailed_SchemaTooNew, 3L, 1),
OpenFailedPageViewModel.BuildMessage(Folder, new SchemaVersionException(3, 1)));
Assert.AreEqual(
Expected(Resources.Error_OpenFailed_DatabaseMissing),
OpenFailedPageViewModel.BuildMessage(Folder, new WorkspaceDatabaseMissingException("/work/repo/.ykanban/ykanban.db")));
Assert.AreEqual(
Expected(Resources.Error_OpenFailed_Database),
OpenFailedPageViewModel.BuildMessage(Folder, new SqliteException("file is not a database", 26)));