[DeckSync] Address auto-sync review: disconnect, backfill and modal conflicts

- Fail the run when the connection drops while a sync is running, and clear
  the active conflict, so the queue is not sent on a dead client and a
  re-login as another account never receives this profile's uploads.
- Backfill last_modified from upload_time in the 37 -> 38 migration and drop
  the "last_modified is null" arm from the sync-check query, so rows that
  predate the column stop reporting as changed on every poll.
- Skip conflicts during auto runs and report how many were skipped, instead
  of opening the modal conflict dialog from a timer or a file-watcher event.
This commit is contained in:
Lukas Brübach 2026-11-01 13:40:50 +01:00 • committed by Lukas Brübach
parent 00cb839a30
commit 6d67b76fa3
4 changed files with 41 additions and 3 deletions

View file

@ -16,6 +16,12 @@ ALTER TABLE `cockatrice_decklist_files`
ADD COLUMN `last_modified` datetime NULL AFTER `hash`,
ADD COLUMN `deleted` tinyint(1) NOT NULL DEFAULT 0 AFTER `last_modified`;
-- Rows created before this migration only get a last_modified when a client
-- re-uploads them, so every sync check would keep reporting them as changed.
-- Backfill from the upload time once, here, instead of carrying a
-- "last_modified is null" branch in the poll query forever.
UPDATE `cockatrice_decklist_files` SET `last_modified` = `upload_time` WHERE `last_modified` IS NULL;
CREATE TABLE IF NOT EXISTS `cockatrice_deck_versions` (
`id` int(7) unsigned zerofill NOT NULL auto_increment,
`deck_id` int(7) unsigned zerofill NOT NULL,