Conversation
Contributor
There was a problem hiding this comment.
Does this consider the delay for the first walking portion before you get onto the bus? I think you will also need to check if the first bus in the directions is delayed and if so, add that time to the first walking portion of the directions (when you walk to the bus stop).
cindy-x-liang
approved these changes
Nov 10, 2024
Aayush-Agnihotri
approved these changes
Nov 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.jsto 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:
