fix(ui): use effective pull date in colophon to avoid false pull overdue diagnoses
CI / Typecheck, test, feed (push) Successful in 15s
CI / Build site (push) Successful in 8s
CI / Container image (push) Successful in 30s

Derive source pull date from confirmation and recent content updates, preventing recently updated sources from displaying as pulled never or pull overdue.
This commit is contained in:
Lucas Winther
2026-09-18 09:33:56 +02:00
parent 157b9fe20c
commit 941d8095ea
2 changed files with 51 additions and 4 deletions
+13 -4
View File
@@ -298,8 +298,17 @@ export function Colophon({
{shownStale.flatMap((g) =>
g.sources.map((src) => {
const site = siteFor(src.url);
const confirmed = src.lastConfirmedAt
? `${formatRemaining(now - Date.parse(src.lastConfirmedAt))} ago`
const pullDate =
src.lastConfirmedAt !== null &&
src.contentChangedAt !== null &&
Date.parse(src.lastConfirmedAt) >= Date.parse(src.contentChangedAt)
? src.lastConfirmedAt
: (src.lastConfirmedAt ??
(src.contentChangedAt && now - Date.parse(src.contentChangedAt) <= STALE_AFTER_MS
? src.contentChangedAt
: null));
const confirmed = pullDate
? `${formatRemaining(now - Date.parse(pullDate))} ago`
: "never";
const updated = src.contentChangedAt
? `${formatRemaining(now - Date.parse(src.contentChangedAt))} ago`
@@ -307,8 +316,8 @@ export function Colophon({
? `${formatRemaining(now - Date.parse(src.lastSuccessAt))} ago`
: "never";
const isPullRecent =
src.lastConfirmedAt !== null &&
now - Date.parse(src.lastConfirmedAt) <= STALE_AFTER_MS;
pullDate !== null &&
now - Date.parse(pullDate) <= STALE_AFTER_MS;
const isContentStale =
src.contentChangedAt === null ||
now - Date.parse(src.contentChangedAt) > STALE_AFTER_MS;