From 9ebe839e1559a623efed5204c67503f642acd7eb Mon Sep 17 00:00:00 2001 From: "robbie.sundstrom" Date: Tue, 9 Jun 2026 17:41:04 -0400 Subject: [PATCH 1/2] fix: Full closure at Symphony showing as partial in reconstructed_alert --- .../v2/candidate_generator/widgets/reconstructed_alert.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex b/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex index b845a7ac2..65ea6b214 100644 --- a/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex +++ b/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex @@ -163,7 +163,8 @@ defmodule Screens.V2.CandidateGenerator.Widgets.ReconstructedAlert do # Given informed entities representing an alert at a single station, # finds the corresponding platform names for those child stops included. with [informed_parent_station] <- Alert.informed_parent_stations(alert), - [_ | _] = child_platforms <- informed_parent_station.stop.child_stops, + [_ | _] = child_platforms <- + informed_parent_station.stop.child_stops |> Stop.filter_subway_platforms(), :partial_closure <- Alert.station_closure_type(alert, child_platforms) do platform_ids = child_platforms |> Stop.filter_subway_platforms() |> Enum.map(& &1.id) |> MapSet.new() From 2538fa0c03992077956cc3cbf6f3cd9a870acc84 Mon Sep 17 00:00:00 2001 From: "robbie.sundstrom" Date: Tue, 9 Jun 2026 17:59:58 -0400 Subject: [PATCH 2/2] move to shared function in InformedEntity --- lib/screens/alerts/informed_entity.ex | 12 ++++++++++++ .../widgets/reconstructed_alert.ex | 4 ++-- .../v2/widget_instance/subway_status/serialize.ex | 10 ++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/screens/alerts/informed_entity.ex b/lib/screens/alerts/informed_entity.ex index d5916e2fe..848e75fa5 100644 --- a/lib/screens/alerts/informed_entity.ex +++ b/lib/screens/alerts/informed_entity.ex @@ -76,4 +76,16 @@ defmodule Screens.Alerts.InformedEntity do end) |> Enum.filter(fn ie -> not is_nil(ie.stop) end) end + + @spec boarding_platforms_from_entities([t()]) :: [Stop.t()] + def boarding_platforms_from_entities(informed_parent_stations) do + informed_parent_stations + |> Enum.flat_map( + &case &1.stop.child_stops do + nil -> [] + child_stops -> child_stops + end + ) + |> Stop.filter_subway_platforms() + end end diff --git a/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex b/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex index 65ea6b214..3cd5b9aae 100644 --- a/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex +++ b/lib/screens/v2/candidate_generator/widgets/reconstructed_alert.ex @@ -164,10 +164,10 @@ defmodule Screens.V2.CandidateGenerator.Widgets.ReconstructedAlert do # finds the corresponding platform names for those child stops included. with [informed_parent_station] <- Alert.informed_parent_stations(alert), [_ | _] = child_platforms <- - informed_parent_station.stop.child_stops |> Stop.filter_subway_platforms(), + InformedEntity.boarding_platforms_from_entities([informed_parent_station]), :partial_closure <- Alert.station_closure_type(alert, child_platforms) do platform_ids = - child_platforms |> Stop.filter_subway_platforms() |> Enum.map(& &1.id) |> MapSet.new() + child_platforms |> Enum.map(& &1.id) |> MapSet.new() informed_entities |> Enum.filter(&(&1.stop.id in platform_ids)) diff --git a/lib/screens/v2/widget_instance/subway_status/serialize.ex b/lib/screens/v2/widget_instance/subway_status/serialize.ex index e84a604f0..613db14d6 100644 --- a/lib/screens/v2/widget_instance/subway_status/serialize.ex +++ b/lib/screens/v2/widget_instance/subway_status/serialize.ex @@ -4,8 +4,8 @@ defmodule Screens.V2.WidgetInstance.SubwayStatus.Serialize do """ alias Screens.Alerts.Alert + alias Screens.Alerts.InformedEntity alias Screens.Routes.Route - alias Screens.Stops.Stop alias Screens.V2.WidgetInstance.SubwayStatus alias Screens.V2.WidgetInstance.SubwayStatus.Serialize.GreenLine alias Screens.V2.WidgetInstance.SubwayStatus.Serialize.RedLine @@ -251,13 +251,7 @@ defmodule Screens.V2.WidgetInstance.SubwayStatus.Serialize do child_platforms_at_informed_stations = alert |> Alert.informed_parent_stations() - |> Enum.flat_map( - &case &1.stop.child_stops do - nil -> [] - child_stops -> child_stops - end - ) - |> Stop.filter_subway_platforms() + |> InformedEntity.boarding_platforms_from_entities() case Alert.station_closure_type(alert, child_platforms_at_informed_stations) do # Logic for partial_station_closure will remove any alerts that apply to more than