hotfix(ScheduleDirection): fix line diagram for routes with repeated stops #1760
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.
No ticket - fixing a bug on dev with the 217 & 120 bus route schedule pages.
Background
stop_ids
from trip ++ related improvements #1755The recent PR updated how stops were being fetched for the line diagram, but came with corrected data that broke the line diagram code on at least two pages. It turns out the recursive code that parses the stops to draw the branches on the line diagram assumes that each stop ID is unique, which is assuredly not the case for the 217 and 120 routes, each of which repeat at least one stop along its route.
Highlighted changes
The approach I took here was to just not compute the stop tree for pages for a ferry or bus route. We don't need it - these either don't have line diagrams or have simple lines that won't branch.
Backend
nil
stop treeFrontend
null
stop tree.null
Fixed 217 route
General checks
New endpoints, or non-trivial changes to current endpoints