From e4d44efecc74d440408edf54fbf9fd1a08e89800 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 28 Jan 2021 11:54:48 +1000 Subject: [PATCH] unbury on sync start https://forums.ankiweb.net/t/unburying-works-differently-on-anki-desktop-ankiweb-and-ios-app/6909 --- rslib/src/sync/server.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rslib/src/sync/server.rs b/rslib/src/sync/server.rs index 6385b8a6b..93822c063 100644 --- a/rslib/src/sync/server.rs +++ b/rslib/src/sync/server.rs @@ -100,11 +100,18 @@ impl SyncServer for LocalServer { self.client_is_newer = client_is_newer; self.col.storage.begin_rust_trx()?; + + // make sure any pending cards have been unburied first if necessary + let timing = self.col.timing_today()?; + self.col.unbury_if_day_rolled_over(timing)?; + + // fetch local graves let server_graves = self.col.storage.pending_graves(client_usn)?; - // Handle AnkiDroid using old protocol + // handle AnkiDroid using old protocol if let Some(graves) = deprecated_client_graves { self.col.apply_graves(graves, self.server_usn)?; } + Ok(server_graves) }