mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 21:54:58 +08:00
041a627765
Addresses review feedback on the too-new-DB recovery flow. - P1: stored_user_version_exceeds_supported() is now checked BEFORE Database::init(), so create_tables()'s DDL (incl. the unconditional DROP INDEX/DROP TABLE IF EXISTS failover_queue) never runs against a database whose user_version we cannot understand. The earlier post-init-failure recovery branch is removed; the pre-check is the single authoritative guard, so "don't write to a DB we can't read" now holds from the very first DB access. - P2: the window CloseRequested handler now detects recovery mode (init_error kind = db_version_too_new) and exits the app instead of honoring minimize_to_tray_on_close. Recovery mode returns before the tray is created, so hiding the window would leave the app running with no tray to bring it back; native-close now quits cleanly. Verified: cargo fmt --check clean; cross-model Rust review of both fixes (compile-correctness + no normal-startup/close regression).