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

hotfix(TimetableController): handle no route patterns #2414

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

thecristen
Copy link
Collaborator

The timetable logic assumes canonical route patterns exist for every route. When that doesn't happen to be the case, we should gracefully handle that. This PR stops Enum.EmptyError from ruining everything, by setting an initial accumulator for Enum.reduce/3!

The test is a little silly at this point but it did help me clearly see the fail vs success state!

@thecristen thecristen requested a review from a team as a code owner March 4, 2025 21:00
Copy link
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📆

[]
end)

assert build_timetable(conn, @schedules)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Is there a way to make a non-trivial relevant empty-state assertion for this use case? Like that it pulls a route pattern from somewhere else, or that it has a reasonable empty state (empty list, "No route pattern exists you bozo" string, or something like that?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... a followup to test the "no trips here" version of the page will do

@thecristen thecristen merged commit 7014eba into main Mar 5, 2025
20 checks passed
@thecristen thecristen deleted the cbj/hotfix-timetable-route-patterns branch March 5, 2025 17:19
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