Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/carriers/stcourier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions workers/poller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ async function sha256Hex(input: string): Promise<string> {
async function processWatch(env: Env, w: WatchRow): Promise<void> {
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;
}
Expand Down
Loading