From b611e8ea6fcba712e0d0e0b1f66cb1b2a1182124 Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Sun, 8 Nov 2026 19:11:59 +0100 Subject: [PATCH] Apply suggestion from @ZeldaZach Co-authored-by: Zach H --- cockatrice/src/interface/deck_sync/deck_sync_manager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/interface/deck_sync/deck_sync_manager.cpp b/cockatrice/src/interface/deck_sync/deck_sync_manager.cpp index 54447babe..336e69868 100644 --- a/cockatrice/src/interface/deck_sync/deck_sync_manager.cpp +++ b/cockatrice/src/interface/deck_sync/deck_sync_manager.cpp @@ -460,10 +460,11 @@ void DeckSyncManager::classify(const QMap &serverFiles) } const DeckSyncRecord baseRecord = sidecar.get(it.key()); const bool localChanged = baseRecord.baseHash.isEmpty() || baseRecord.baseHash != it.value().hash; - // A server row without a hash predates sync: treat it as unknown rather than changed, - // otherwise every sync re-downloads the deck. + // A server row without a hash predates sync: with a base, treat it as unknown + // rather than changed (otherwise every sync re-downloads the deck). Without a + // base nothing says the server copy is unchanged, so it must not lose silently. const bool serverChanged = - !server.hash.isEmpty() && (baseRecord.baseHash.isEmpty() || baseRecord.baseHash != server.hash); + baseRecord.baseHash.isEmpty() || (!server.hash.isEmpty() && baseRecord.baseHash != server.hash); if (localChanged && !serverChanged) { if (syncMode == DeckSyncMode::DownloadOnly) { continue;