-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Make trip channel pull from ETS predictions #235
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! A few tiny comments
predictions_by_stop: %{Stop.id() => %{Prediction.id() => Prediction.t()}}, | ||
trips: %{Trip.id() => Trip.t()}, | ||
vehicles: %{Vehicle.id() => Vehicle.t()} | ||
} | ||
|
||
@type subscribe_trip_response :: %{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion(non-blocking): add the new trip_id
field here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't understand what you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a trip_id field added to the map here, I think it would be worth adding to the typespec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, okay yes, updated
Summary
Ticket: Fix trip details crash when trip not in service
Update the
predictions:trip:<trip_id>
channel to use the same ETS table that predictions by stop are pulling from. This also better handles the case where the frontend passes an added trip ID that doesn't exist in the trips endpoint, which can happen frequently for vehicles near the end of a line. Now instead of crashing on the backend, an error is returned to the frontend.Added tests for new behavior