Fix ZeldaZach review for PR 7496: deck path in ctor, server-time baseline, single-query sync check

This commit is contained in:
Lukas Brübach 2026-10-13 07:21:42 +02:00
parent e73fcd602c
commit 8bb0a9b98a
6 changed files with 30 additions and 41 deletions

View file

@ -299,11 +299,9 @@ void DeckSyncManager::syncNow()
.modified = QFileInfo(absolutePath).lastModified()});
}
if (!firstSyncRun && sidecar.lastSyncSecs > 0) {
sendSyncCheck(sidecar.lastSyncSecs);
return;
}
fetchFullList();
// Always ask the server first: its server_time becomes the sync baseline,
// so uploads racing the DeckList response cannot fall outside the window.
sendSyncCheck(sidecar.lastSyncSecs);
}
void DeckSyncManager::fetchFullList()
@ -334,6 +332,9 @@ void DeckSyncManager::onCheckFinished(const Response &response, const CommandCon
return;
}
const Response_DeckSyncStatus &status = response.GetExtension(Response_DeckSyncStatus::ext);
if (status.has_server_time()) {
pendingServerTime = static_cast<qint64>(status.server_time());
}
DeckSyncSidecar sidecar(sidecarPath);
if (!sidecar.load()) {
fetchFullList();