Stop 'timing out' old 'created' notifications

This is being replaced with a new alert and runbook [1]. It's not
always appropriate to change the status to 'technical-failure', and
the new alert means we'll act to fix the underlying issue promptly.

We'll look at tidying up the remaining code in the next commits.

[1]: https://github.com/alphagov/notifications-manuals/wiki/Support-Runbook#deal-with-email-or-sms-still-in-created
This commit is contained in:
Ben Thorner
2021-11-25 16:59:26 +00:00
parent 2acc4ee67d
commit 0318229216
4 changed files with 11 additions and 27 deletions

View File

@@ -703,12 +703,12 @@ def test_dao_timeout_notifications(sample_template):
assert Notification.query.get(sending.id).status == 'sending'
assert Notification.query.get(pending.id).status == 'pending'
assert Notification.query.get(delivered.id).status == 'delivered'
technical_failure_notifications, temporary_failure_notifications = dao_timeout_notifications(1)
assert Notification.query.get(created.id).status == 'technical-failure'
temporary_failure_notifications = dao_timeout_notifications(1)
assert Notification.query.get(created.id).status == 'created'
assert Notification.query.get(sending.id).status == 'temporary-failure'
assert Notification.query.get(pending.id).status == 'temporary-failure'
assert Notification.query.get(delivered.id).status == 'delivered'
assert len(technical_failure_notifications + temporary_failure_notifications) == 3
assert len(temporary_failure_notifications) == 2
def test_dao_timeout_notifications_only_updates_for_older_notifications(sample_template):
@@ -722,8 +722,8 @@ def test_dao_timeout_notifications_only_updates_for_older_notifications(sample_t
assert Notification.query.get(sending.id).status == 'sending'
assert Notification.query.get(pending.id).status == 'pending'
assert Notification.query.get(delivered.id).status == 'delivered'
technical_failure_notifications, temporary_failure_notifications = dao_timeout_notifications(1)
assert len(technical_failure_notifications + temporary_failure_notifications) == 0
temporary_failure_notifications = dao_timeout_notifications(1)
assert len(temporary_failure_notifications) == 0
def test_dao_timeout_notifications_doesnt_affect_letters(sample_letter_template):
@@ -737,8 +737,8 @@ def test_dao_timeout_notifications_doesnt_affect_letters(sample_letter_template)
assert Notification.query.get(sending.id).status == 'sending'
assert Notification.query.get(pending.id).status == 'pending'
assert Notification.query.get(delivered.id).status == 'delivered'
technical_failure_notifications, temporary_failure_notifications = dao_timeout_notifications(1)
temporary_failure_notifications = dao_timeout_notifications(1)
assert len(temporary_failure_notifications) == 0
def test_should_return_notifications_excluding_jobs_by_default(sample_template, sample_job, sample_api_key):