From d4353ee5a1553edbe763e4da8aaea59e66b68239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 28 Oct 2026 15:16:21 +0300 Subject: [PATCH] =?UTF-8?q?=E2=8F=B0=20backup:=20an=20attempt=20stamped=20?= =?UTF-8?q?in=20the=20future=20counts=20as=20due?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/in-web/src/backup.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/in-web/src/backup.rs b/crates/in-web/src/backup.rs index a01ed08..d94f233 100644 --- a/crates/in-web/src/backup.rs +++ b/crates/in-web/src/backup.rs @@ -144,7 +144,9 @@ async fn record_outcome(store: &Store, outcome: &in_core::error::Result, interval_hours: u32) -> bool { let interval = Duration::from_secs(u64::from(interval_hours) * 60 * 60); - last_attempt.is_none_or(|stamp| stamp < stamp_before(interval).as_str()) + // An attempt stamped in the future means the clock went back: run rather than wait for it. + let now = now_stamp(); + last_attempt.is_none_or(|stamp| stamp < stamp_before(interval).as_str() || stamp > now.as_str()) } /// True when there is no successful backup within the limit: [`STALE_AFTER`] or two backup intervals,