From 8d5e4ee0527b7ca04ba6e32f7871dbfccc9d6237 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Mon, 28 Sep 2026 17:11:32 -0700 Subject: [PATCH] Explain: don't prepare answers for date fields --- crates/jmap/src/inbuxa/explanation.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/jmap/src/inbuxa/explanation.rs b/crates/jmap/src/inbuxa/explanation.rs index b5e54b9..d0a9975 100644 --- a/crates/jmap/src/inbuxa/explanation.rs +++ b/crates/jmap/src/inbuxa/explanation.rs @@ -798,6 +798,10 @@ mod tests { assert!(delivery_facts(&mut Facts::default(), &message, "no@example.com").is_err()); } + fn is_timestamp(value: &str) -> bool { + chrono::DateTime::parse_from_rfc3339(value).is_ok() + } + /// The settings questions a release prepares answers for (EX-26): every /// non-secret property of every settings object, at the object's own /// default, built exactly as a live question is. @@ -842,6 +846,12 @@ mod tests { if info.secret { continue; } + // A date's default is the moment the object is built, so its + // question changes every run and no live question ever + // matches it: nothing worth preparing. + if matches!(map[&property].as_str(), Some(v) if is_timestamp(v)) { + continue; + } let mut facts = Facts::default(); push_setting(&mut facts, &object, &property, &info, &map[&property]); out.push((object.clone(), property, facts)); @@ -856,6 +866,7 @@ mod tests { assert!(questions.len() > 500, "found {}", questions.len()); assert!(questions.iter().any(|(o, p, _)| o == "x:Domain" && p == "dnsManagement")); assert!(!questions.iter().any(|(o, p, _)| o == "x:AiModel" && p == "httpAuth")); + assert!(!questions.iter().any(|(o, p, _)| o == "x:Account" && p == "createdAt")); } /// Writes `resources/explain/settings.json.gz` (EX-26). Run before a