fix(native/mail): kürzlich-blockiert uses createdAt, not the original receive date

User saw entries like "vor 61d · Outlook" under the "Kürzlich
blockiert · In den letzten 24h" header. createdAt (when the daemon
wrote the mail_blocked row) is always inside the 24h retention window
because deleteOldMailBlocked sweeps everything older than that on
every fetch — but the row preserves the original receivedAt header
from the email, which for old Casino mails the daemon only just got
around to scanning can be weeks or months ago.

Switched the time-label in MailActivityLog to format createdAt
instead. The MailBlockedItem type now carries createdAt explicitly
(the backend has been returning it all along, the FE type just hadn't
acknowledged it). receivedAt stays in the shape for any future
"received vs blocked" comparison view but isn't used in the recent-
activity list anymore.
This commit is contained in:
chahinebrini 2026-05-16 05:26:52 +02:00
parent 4573d16e1a
commit 6bbf9e4cfd
2 changed files with 8 additions and 1 deletions

View File

@ -248,7 +248,11 @@ function ActivityItem({
const providerLabel = item.connection?.providerLabel ?? ( const providerLabel = item.connection?.providerLabel ?? (
item.senderEmail ? domainFromEmail(item.senderEmail) : null item.senderEmail ? domainFromEmail(item.senderEmail) : null
); );
const timeLabel = formatDate(item.receivedAt, t); // createdAt = wann WIR die Mail geblockt haben. receivedAt = wann der
// Sender sie ursprünglich rausgeschickt hat — bei alten Casino-Mails die
// wir gerade erst gescant haben, ist das oft Wochen/Monate her und
// verwirrt den User in der "Kürzlich blockiert"-Liste.
const timeLabel = formatDate(item.createdAt, t);
const subLine = [timeLabel, providerLabel].filter(Boolean).join(' · '); const subLine = [timeLabel, providerLabel].filter(Boolean).join(' · ');
return ( return (

View File

@ -6,7 +6,10 @@ export type MailBlockedItem = {
subject: string; subject: string;
senderEmail: string; senderEmail: string;
senderName: string | null; senderName: string | null;
/** Wann die Mail beim Sender raus / im User-Postfach ankam (kann Wochen zurückliegen). */
receivedAt: string; receivedAt: string;
/** Wann der Daemon die Mail geblockt hat — das ist die richtige Zeit für "Kürzlich blockiert". */
createdAt: string;
connectionId: string; connectionId: string;
connection?: { connection?: {
id: string; id: string;