Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Display error state when trip doesn't exist #527

Merged
merged 7 commits into from
Nov 12, 2024

Conversation

EmmaSimon
Copy link
Contributor

Summary

Ticket: Fix trip details crash when trip not in service

We can get added trip IDs that don't exist in the API in trip details, which before these changes was resulting in shimmer loading forever. Worse, it would continue to shimmer load even after switching to a different vehicle on the map.

Now, the trip header will be displayed, and scheduled stops will be displayed if they exist. Also fixed a related issue where zipPredictedSchedules would throw an exception if the sequence of predictions didn't exactly match the sequence of scheduled stops, sometimes in the actual data this can happen though, so now it just skips the scheduled stop and keeps checking to see if the next ones match.

Testing

Updated test behavior to check for new state. Tested locally with mbta/mobile_app_backend#235

We can get added trip IDs that don't exist in the API in trip details,
which before these changes was resulting in shimmer loading forever.
Worse, it would continue to shimmer load even after switching to a
different vehicle on the map.
@EmmaSimon EmmaSimon requested a review from a team as a code owner November 7, 2024 21:05
@EmmaSimon EmmaSimon merged commit 49c744d into main Nov 12, 2024
7 checks passed
@EmmaSimon EmmaSimon deleted the es-trip-not-in-service branch November 12, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants