fix(stcourier): use the newest scan as the headline status - #26
Merged
Conversation
ST Courier's "Current Status" summary cell lags its own timeline: for AWB 64424565531 it still read "In Transit" while the latest scan was already "Out for Delivery". Preferring that cell made /api/track and the public tracking page report a status behind the scan list rendered right below it. Prefer the newest scan (matching the Blue Dart carrier) and keep the summary cell only as a fallback for shipments with no scans yet. Also log unknown carriers in the poller instead of skipping in silence. The poller is deployed separately from the web app, so a newly registered carrier is live on the site while this worker still runs the old bundle. That path stamped last_polled_at and left last_known_status null, so the dashboard read "awaiting first scan" indefinitely and no alerts fired, with nothing in the logs to explain why. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
shiptrack | 0fa66a0 | Commit Preview URL Branch Preview URL |
Sep 04 2026, 10:29 AM |
Aswincloud-Bot
approved these changes
Sep 4, 2026
Aswincloud-Bot
left a comment
There was a problem hiding this comment.
Auto-approved: @Aswinmcw is a member of @Aswincloud/admins.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
shiptrack-poller | 0fa66a0 | Sep 04 2026, 10:29 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes from the first live multi-scan ST Courier shipment (AWB
64424565531).1. Headline status lagged the scan list
ST Courier's "Current Status" summary cell is not kept in sync with their own timeline:
#25preferred that cell, so/api/track/stcourier/...and the public tracking page reportedin_transitwhile rendering anOut for Deliveryscan directly beneath it.Now prefers the newest scan — matching the Blue Dart carrier — with the summary cell kept only as a fallback for shipments that have no scans yet.
This did not affect alerting or delivered-detection: the poller already keys
lastKnownStatusand theTERMINALcheck offlatest.status, notresult.status.2. Poller skipped unknown carriers silently
The poller is deployed separately from the web app (
npm run deploy:poller, no CI workflow), so a carrier added to the registry goes live on the site whileshiptrack-pollerstill runs the previous bundle. In that window:markPolledstampslast_polled_atbut leaveslast_known_statusnull — so the dashboard shows "awaiting first scan" forever with a fresh last-poll timestamp, no alerts fire, and nothing appears in the logs. That's exactly what happened to the first ST Courier watch after#25merged.This adds a
console.warnnaming the watch and carrier. It doesn't change behaviour — skipping is still correct — it just makes the stale-deploy window diagnosable.Also confirmed
The open question from
#25— ST Courier's scan render order — is now settled against a 3-scan shipment.parseScansreturns correct oldest-first ordering:tsc --noEmitclean.🤖 Generated with Claude Code