diff --git a/src/carriers/stcourier.ts b/src/carriers/stcourier.ts index 9eafbbf..64ec57b 100644 --- a/src/carriers/stcourier.ts +++ b/src/carriers/stcourier.ts @@ -219,9 +219,11 @@ export const stcourier: Carrier = { return { carrier: "stcourier", trackingNumber: cleaned, - // Prefer the summary cell — it's ST Courier's own rollup — and fall back - // to the newest scan when the table is missing. - status: current ? mapStatus(current) : latest ? latest.status : "unknown", + // Prefer the newest scan. ST Courier's "Current Status" summary cell lags + // its own timeline — it still read "In Transit" while the latest scan was + // already "Out for Delivery" — so it's only a fallback when there are no + // scans to read. + status: latest ? latest.status : current ? mapStatus(current) : "unknown", origin, destination, events, diff --git a/workers/poller/index.ts b/workers/poller/index.ts index 6ad207a..43497eb 100644 --- a/workers/poller/index.ts +++ b/workers/poller/index.ts @@ -29,6 +29,14 @@ async function sha256Hex(input: string): Promise { async function processWatch(env: Env, w: WatchRow): Promise { const carrier = getCarrier(w.carrier); if (!carrier) { + // The poller is deployed separately from the web app (`npm run + // deploy:poller`), so a carrier added to the registry is live on the site + // while this worker still has the old bundle. That combination silently + // stamps last_polled_at and leaves last_known_status null — the dashboard + // shows "awaiting first scan" forever and no alerts fire. Log it loudly. + console.warn( + `watch ${w.id} references unknown carrier "${w.carrier}" — this poller bundle predates it; redeploy the poller.`, + ); await markPolled(env.DB, w.id); return; }