Skip to content

Commit 6b00a16

Browse files
authored
fix(ui): the scheduled deletion date says UTC, like every other date (#570)
The account history said a scheduled deletion as "Account deletion scheduled for 3 Dec 2026", without "UTC". It now reads "Account deletion scheduled for 3 Dec 2026 UTC", through `Precision::Day.write` like every other date. The deletion notification, shown on its page and in its email, wrote the same date without "UTC" too ("deleted for good on 3 December 2026"); it now ends in "UTC", the way emails write dates. The entry stays text, not a `<time>` element: the history's description is also the "This wasn't me" button's accessible name and the history entry shown on the notification's page, and `Precision::write` is the shared form for dates in text, as the sessions' and recovery's labels use it. Closes #551 Tested: a new `sourceorigin-ui` test checks the entry's text, and fails without the fix (it read "…3 Dec 2026"); the crate's tests, Clippy with and without `--all-features`, `cargo doc` and `just rust unused` pass. No screenshot shows a scheduled deletion. > [!NOTE] > Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent d1db1a0 commit 6b00a16

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎crates/common/src/notifications/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl Notification {
645645
Self::AccountEnabled => "You can sign in to it again.".to_owned(),
646646
Self::DeletionScheduled { purge_after } => format!(
647647
"It will be deleted for good on {}, with everything SourceOrigin knows about you. Until then, signing in lets you restore it.",
648-
purge_after.format("%-d %B %Y")
648+
purge_after.format("%-d %B %Y UTC")
649649
),
650650
Self::AccountRestored => "It is no longer scheduled for deletion.".to_owned(),
651651
Self::NewDeviceSignIn => "A browser that had never signed in to your account did. If it was you, there is nothing to do. If it wasn’t, open this notification and select “This wasn’t me”, or sign out everywhere from the link in its email.".to_owned(),

‎crates/ui/src/settings/timeline.rs‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl HistoryRow<'_> {
216216
HistoryEntry::NotificationPreferenceChanged(preference) => preference.change(),
217217
HistoryEntry::DeletionScheduled { purge_after } => format!(
218218
"Account deletion scheduled for {}",
219-
purge_after.format("%-d %b %Y")
219+
Precision::Day.write(*purge_after)
220220
),
221221
HistoryEntry::AccountRestored => "Account restored".to_owned(),
222222
HistoryEntry::CompromiseReported { .. } => {
@@ -580,3 +580,37 @@ impl<'a> Undo<'a> {
580580
}
581581
}
582582
}
583+
584+
#[cfg(test)]
585+
mod tests {
586+
//! What history entries say.
587+
use super::*;
588+
use chrono::TimeZone;
589+
590+
/// A scheduled deletion writes its date as every other date is written:
591+
/// day-first, in UTC.
592+
#[test]
593+
fn a_scheduled_deletion_says_its_date_in_utc() {
594+
let purge_after = Utc
595+
.with_ymd_and_hms(2026, 12, 3, 9, 30, 0)
596+
.single()
597+
.expect("a moment");
598+
let scheduled = HistoryEntry::DeletionScheduled { purge_after };
599+
let row = HistoryRow {
600+
id: EventId::new(),
601+
occurred_at: Utc::now(),
602+
entry: &scheduled,
603+
actor: HistoryActor::Account,
604+
reportable: false,
605+
reason: None,
606+
client: None,
607+
ip: None,
608+
device: None,
609+
erased: false,
610+
};
611+
assert_eq!(
612+
row.describe(&Holdings::default()),
613+
"Account deletion scheduled for 3 Dec 2026 UTC"
614+
);
615+
}
616+
}

0 commit comments

Comments
 (0)