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

unify no service audio code paths #844

Merged
merged 2 commits into from
Nov 14, 2024
Merged

unify no service audio code paths #844

merged 2 commits into from
Nov 14, 2024

Conversation

panentheos
Copy link
Collaborator

Summary of changes

This refactors the Closure and NoServiceToDestination audio modules into a single NoService audio. These code paths were closely related to each other, and unifying them simplifies the calling code. Test coverage is maintained by the suite of higher level cases in realtime_test.exs. Also includes a few minor simplifications to the headway and first-train audio constructors.

@panentheos panentheos requested a review from a team as a code owner November 4, 2024 21:17
%Content.Message.Headways.Bottom{range: {8, 10}}
)
end
test "from_messags/2" do
Copy link
Collaborator

Choose a reason for hiding this comment

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

small typo here

{:ok, destination_text} = PaEss.Utilities.destination_to_ad_hoc_string(destination)
"No #{destination_text} service.#{shuttle}"

use_routes? ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this clause not come first in the cond block? Based on the definition for from_messages/2 above for this special case, it looks like destination could still be truthy

Copy link
Collaborator Author

@panentheos panentheos Nov 12, 2024

Choose a reason for hiding this comment

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

Currently it doesn't matter, because we always generate a destination-less Message.Alert.NoService for this case. I've got a followup PR that changes that code path and this logic, but I went ahead and swapped it anyway.

Copy link
Collaborator

@PaulJKim PaulJKim left a comment

Choose a reason for hiding this comment

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

Looks good!

@panentheos panentheos merged commit a36cd8d into main Nov 14, 2024
2 checks passed
@panentheos panentheos deleted the bhw/no-service-audio branch November 14, 2024 14:12
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