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.
Overview
Fix bug where the final delay time is not accurate.
Changes Made
Added logic in
RouteUtilsV3.js
to iterate over each route in finalBusRoutes, calculates total delay from bus segments, and apply this delay to the 'walk' segment if it follows a delayed bus segment.Test Coverage
Tested routes with no delays, delays, final destination at bus stop, final destination not at bus stop. Finding routes with multiple different bus and walking segments that had delays were a bit difficult, so I just created my own route object with directions to test the code.
Next Steps
Related PRs or Issues
https://github.com/cuappdev/ithaca-transit-ios/issues/392
Screenshots
Original bug (delay not reflected in final time):
Request body:
{
"end": "42.4403, -76.4962",
"uid": "B1CD4726-0CA8-41DC-A2F4-01D5D8F3A3E0",
"time": 1729604959,
"destinationName": "Thompson and Bleeker",
"start": "42.4852, -76.4909",
"arriveBy": false,
"originName": "Target"
}
One of the routes contains a bus delay:
Delay time reflected in final walking segment: