mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[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:
parent
8bb0a9b98a
commit
875e87d1bc
4 changed files with 41 additions and 3 deletions
|
|
@ -904,10 +904,11 @@ bool AbstractServerSocketInterface::syncCheckHelper(int userId, qint64 sinceSecs
|
|||
// their files linger as tombstones, so walking the live folder tree would
|
||||
// miss deletes pointing at nonexistent folders. The client only checks
|
||||
// changed_files_size(), so folder paths are not reconstructed here.
|
||||
// last_modified is backfilled by the 37 -> 38 migration, so a plain range
|
||||
// check is enough.
|
||||
QSqlQuery *query = sqlInterface->prepareQuery("select id, guid, hash, last_modified, deleted from "
|
||||
"{prefix}_decklist_files where id_user = :id_user "
|
||||
"and (last_modified is null or last_modified >= "
|
||||
"FROM_UNIXTIME(:since))");
|
||||
"and last_modified >= FROM_UNIXTIME(:since)");
|
||||
query->bindValue(":id_user", userId);
|
||||
query->bindValue(":since", sinceSecs);
|
||||
if (!sqlInterface->execSqlQuery(query)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue