Skip to content

fix(integrations): alert on TfL line statuses above Good Service - #1018

Merged
Medformatik merged 2 commits into
fix/gbfs-pricing-currencyfrom
fix/tfl-status-severity-scale
Nov 16, 2026
Merged

Medformatik merged 2 commits into
fix/gbfs-pricing-currencyfrom
fix/tfl-status-severity-scale

Conversation

@Medformatik

Copy link
Copy Markdown
Collaborator

What changed and why

Transport for London reports each line's status with a severity code. The provider treated every code of 10 or more as "Good Service" and showed no alert, and it read only the first status of a line.

TfL's scale is not ordered that way. Its own metadata (/Line/Meta/Severity, read on 2026-11-16) lists, for tube, DLR, Elizabeth line, Overground and tram: 10 Good Service, 11 Part Closed, 12 Exit Only, 13 No Step Free Access, 14 Change of frequency, 15 Diverted, 16 Not Running, 17 Issues Reported, 18 No Issues, 19 Information, 20 Service Closed. A line that was not running, or partly closed, produced no alert. A line with two statuses at once, such as minor delays on one section and a part closure on another, showed only the first.

Now:

  • 16 is severe; 11, 12, 13, 15 and 17 are warnings; 14 and 19 are information. Codes 0 to 9 keep their mapping.
  • 10, 18 and 20 produce no alert. 20 is the routine overnight closure: as an alert, every line would carry a "Service Closed" card each night. Unplanned closures use 1, 2 or 16, which do alert.
  • An unknown code above 20 is shown as information, so a new status is not hidden.
  • Every status of a line is represented, one alert per distinct code; statuses with the same code merge and list each reason once.

Alert ids gain the code (tfl:status:central:5). Nothing parses or stores these ids; they serve as list keys and for announce-once.

Verification

  • tfl.test.ts: 16 and 11 produce alerts, the other notice codes map as above, 10, 18, 20 and a missing severity produce none, several statuses on one line are all represented and same-code ones merge, and 0 to 9 are unchanged. Three new cases failed before the change; the existing alert test changed only in its id.
  • The integrations typecheck printed no errors and Biome on the touched files passes locally.
  • Not verified: against the live line-status endpoint. The repository has no recorded line-status response.

Release and upgrade impact

Product impact: ordinary

No package release: the extension CLI bundles some shared sources but none of the code changed in this stack; its built bundle contains no trace of it.

@Medformatik Medformatik self-assigned this Nov 16, 2026
@Medformatik
Medformatik added this pull request to stack #1006 November 16, 2026 10:13
@Medformatik
Medformatik merged commit ba31021 into main Nov 16, 2026
42 checks passed
@Medformatik
Medformatik deleted the fix/tfl-status-severity-scale branch November 16, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants