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: handle split alert statuses for signs in headway mode #800

Merged

Conversation

sloanelybutsurely
Copy link
Contributor

@sloanelybutsurely sloanelybutsurely commented Jul 22, 2024

@PaulJKim pointed out that mezzanine signs when set to :headway mode check alert status but that code hadn't been updated to handle when alert statuses are different between top and bottom source configurations.

This change intercepts split alert status values passed to get_alert_messages/2 and gets the highest priority alert status of the two using Engine.Alerts.higher_priority_status/2 before continuing on to the existing implementation.

@sloanelybutsurely
Copy link
Contributor Author

sloanelybutsurely commented Jul 22, 2024

@PaulJKim I think this should fix the issue you brought up here: #797 (comment)

I'll work on adding a test case for this. Done.

@sloanelybutsurely sloanelybutsurely force-pushed the push-opyupwmzvxsr branch 2 times, most recently from 9a2c6cf to 7184498 Compare July 22, 2024 17:11
@mbta mbta deleted a comment from github-actions bot Jul 22, 2024
@mbta mbta deleted a comment from github-actions bot Jul 22, 2024
@sloanelybutsurely sloanelybutsurely force-pushed the sloane/support-split-alert-status branch from 90c4be5 to 80cdebc Compare July 23, 2024 13:44
@sloanelybutsurely sloanelybutsurely force-pushed the push-opyupwmzvxsr branch 2 times, most recently from 0e8dfa7 to 54f89a6 Compare July 23, 2024 13:59
@mbta mbta deleted a comment from github-actions bot Jul 23, 2024
@mbta mbta deleted a comment from github-actions bot Jul 23, 2024
@PaulJKim
Copy link
Collaborator

@sloanelybutsurely I'm not sure if we'd be maintaining the existing behavior by taking the first non-nil message. We might need to distill things back down to one 'max stop status' if it's a mezzanine sign with differing alert statuses for either line. https://github.com/mbta/realtime_signs/blob/main/lib/engine/alerts/fetcher.ex#L20-L52

@PaulJKim pointed out that mezzanine signs when set to `:headway` mode
check alert status but that code hadn't been updated to handle when
alert statuses are different between `top` and `bottom` source
configurations.

This change intercepts split alert status values passed to
`get_alert_messages/2` and gets the highest priority alert status of the
two using `Engine.Alerts.higher_priority_status/2` before continuing on
to the existing implementation.
@mbta mbta deleted a comment from github-actions bot Jul 24, 2024
@mbta mbta deleted a comment from github-actions bot Jul 24, 2024
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 to me!

@sloanelybutsurely sloanelybutsurely merged commit 3153b1d into sloane/support-split-alert-status Jul 24, 2024
2 checks passed
@sloanelybutsurely sloanelybutsurely deleted the push-opyupwmzvxsr branch July 24, 2024 18:13
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