Compare severity in send_alert's no-op update check (#24084)

send_alert()'s short circuit for skipping a no-op "update" push only
compared object and zone counts between before/after, never severity.
Both underlying collections are cumulative and deduplicated (objects
is a set of labels, zones only appends a zone not already present),
so a segment being promoted from detection to alert can leave both
counts unchanged, silently dropping the single most notable
transition in a review's life. Add a severity comparison to the same
check so a detection -> alert promotion always notifies.
This commit is contained in:
nulledy 2026-08-24 13:50:32 -04:00 committed by GitHub
parent 41bc24cce4
commit 65fe6b610a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -421,6 +421,7 @@ class WebPushClient(Communicator):
# Don't notify if message is an update and important fields don't have an update
if (
state == "update"
and payload["before"]["severity"] == payload["after"]["severity"]
and len(payload["before"]["data"]["objects"])
== len(payload["after"]["data"]["objects"])
and len(payload["before"]["data"]["zones"])