Skip to content

Alert text missing when short_header is empty #35

@mkbehr

Description

@mkbehr

Checking for Red Line alerts today, I'm getting an alert that just says "DELAY:"

Image

It looks like this is because the client is using the alert's short_header, but this one only has header populated:

$ curl -s "https://api-v3.mbta.com/alerts?filter%5Broute%5D=Red&api_key=$MBTA_API_KEY" | jq '.data[1] | {effect: .attributes.effect, short_header: .attributes.short_header, header: .attributes.header, description: .attributes.description}'
{
  "effect": "DELAY",
  "short_header": "",
  "header": "Red Line Braintree Branch: Delays of about 15 minutes due to a signal problem near Quincy Center. Trains may stand by at stations.",
  "description": "Affected stops:\r\nAlewife\r\nDavis\r\nPorter\r\nHarvard\r\nCentral\r\nKendall/MIT\r\nCharles/MGH\r\nPark Street\r\nDowntown Crossing\r\nSouth Station\r\nBroadway\r\nAndrew\r\nJFK/UMass\r\nNorth Quincy\r\nWollaston\r\nQuincy Center\r\nQuincy Adams\r\nBraintree"
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions