Make the update check survive damaged launcher state and an unavailable database

A crash during a launcher write can leave .state/*.json zero-filled, which made
every launcher start (and so the update check) fail with "Something went wrong".
Zero-filled state files are now discarded before each launcher verb, the check
degrades to a warning when the database cannot be inspected, and database start
failures carry the launcher's own output.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ДмитрийandClaude Sonnet 5.5 committed 2026-10-08 06:56:03 +05:00
1 parent fac6ce469a
commit c6e8a34509
13 files changed
+80 -4

No files matched your search

+1 -1
View File
@@ -3,5 +3,5 @@ import type { UpdatePreview } from "./api";
export function isUpdateCurrent(preview: UpdatePreview): boolean {
return preview.from_version === preview.to_version
&& preview.items.every((item) => item.action === "skip")
&& (preview.pending_migrations ?? (preview.migrations === 0 ? 0 : undefined)) === 0;
&& (preview.database_check_error !== undefined || (preview.pending_migrations ?? (preview.migrations === 0 ? 0 : undefined)) === 0);
}