From f441d5b4ce082c59b4d405c22c13213d317667e8 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Wed, 3 Feb 2021 11:37:02 +0000 Subject: [PATCH] Add comment about service channels for updating --- app/celery/broadcast_message_tasks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/celery/broadcast_message_tasks.py b/app/celery/broadcast_message_tasks.py index 6d37b871f..bd5d38b47 100644 --- a/app/celery/broadcast_message_tasks.py +++ b/app/celery/broadcast_message_tasks.py @@ -75,6 +75,12 @@ def send_broadcast_provider_message(broadcast_event_id, provider): previous_provider_messages=broadcast_event.get_earlier_provider_messages(provider), sent=broadcast_event.sent_at_as_cap_datetime_string, expires=broadcast_event.transmitted_finishes_at_as_cap_datetime_string, + # We think an alert update should always go out on the same channel that created the alert + # We recognise there is a small risk with this code here that if the services channel was + # changed between an alert being sent out and then updated, then something might go wrong + # but we are relying on service channels changing almost never, and not mid incident + # We may consider in the future, changing this such that we store the channel a broadcast was + # sent on on the broadcast message itself and pick the value from there instead of the service channel=channel ) elif broadcast_event.message_type == BroadcastEventMessageType.CANCEL: