feat(SF2.0/UpcomingDepartures): show no realtime #2893
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.
Scope
Asana Ticket: [SF/UD] All Modes: "No predictions" message (plus next N scheduled trips for non-subway)
Implementation
Adds even more logic to
upcoming_departures/1, now outputting two new states:{:no_realtime, upcoming_departures}which will let us show schedule-only output:no_realtimewith no other accompanying outputScreenshots
How to test
Find a route and stop that are in service but are without predictions. This can be tricky. Commuter rail stops are a good bet, since predictions are not usually available far in advance of the trip, and trips are spaced apart. Sometimes light rail termini will show this too.
Running the code locally you can set
all_predictions = [], though it's not a 100% faithful representation since vehicle data will still be around to populate bus crowding.