From 9f98cf6a6b77efc9a2f985d778fe456583a8bec3 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Tue, 6 Oct 2026 16:34:46 +0000 Subject: [PATCH] Merge identical alerts through the contact alert, which does not block a key --- tests/test_app.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index 3d59c9c..bce37d2 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -538,19 +538,25 @@ class AppHandlerTests(ServerTestCase): self.assertEqual(alerts[0]["check_id"], older_id) def test_alerts_api_merges_identical_alerts_and_keeps_the_newest(self): - older = unavailable_payload(self.key_profiles()[1]) + # A second check for a key with an open alert would be blocked + # (section 26.1), so the informational contact alert is used here: it + # carries no key and never blocks one. + key = self.key_profiles()[1] + older = sample_payload(key) older["checked_at"] = "2026-01-01" + older["contact_info_verified"] = "Needs external update" older_id = self.post_health_check(older) - newer = unavailable_payload(self.key_profiles()[1]) + newer = sample_payload(key) newer["checked_at"] = "2027-01-01" + newer["contact_info_verified"] = "Needs external update" newer_id = self.post_health_check(newer) alerts = self.get_alerts() self.assertNotEqual(older_id, newer_id) self.assertEqual(len(alerts), 1) - self.assertEqual(alerts[0]["code"], "key_unavailable") + self.assertEqual(alerts[0]["code"], "contact_info_unconfirmed") self.assertEqual(alerts[0]["check_id"], newer_id) self.assertEqual(alerts[0]["checked_at"], "2027-01-01")