oncall-engine/engine/apps/mobile_app
Joey Orlando 72e7224ad3
do not retry firebase.messaging.UnregisteredError exceptions for FCM relay tasks (#3637)
# What this PR does

_tldr_; we had a lengthy discussion about this
[here](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1701893410542629?thread_ts=1701690117.016909&cid=C04JCU51NF8).
`firebase.messaging.UnregisteredError` errors occur because of events
outside of our control and retrying will never fix them, therefore we
should simply skip retrying in this case.

We retry these fairly often
([logs](https://ops.grafana-ops.net/explore?schemaVersion=1&panes=%7B%22iWZ%22:%7B%22datasource%22:%22000000193%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%23%20%7Bcluster%3D~%5C%22prod-%28eu-west-0%7Cus-central-0%29%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22%7D%20%7C%3D%20%5C%22task_name%3Dapps.webhooks.tasks.trigger_webhook.execute_webhook%5C%22%20%7C%3D%20%5C%22retry%5C%22%5Cn%7Bcluster%3D~%5C%22prod-%28eu-west-0%7Cus-central-0%29%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22%7D%20%7C%3D%20%5C%22apps.mobile_app.fcm_relay.fcm_relay_async%5C%22%20%7C%3D%20%5C%22UnregisteredError%5C%22%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22000000193%22%7D,%22editorMode%22:%22code%22%7D%5D,%22range%22:%7B%22from%22:%22now-7d%22,%22to%22:%22now%22%7D%7D%7D&orgId=1))
which eats up unnecessary celery worker resources.

Related to https://github.com/grafana/oncall-private/issues/1820

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2024-01-09 08:14:20 -05:00
..
migrations Fix db migration for mobile app (#3260) 2023-11-02 16:40:26 +00:00
tasks Add missing success log entries for personal notifications (#3557) 2023-12-14 18:32:26 +00:00
tests do not retry firebase.messaging.UnregisteredError exceptions for FCM relay tasks (#3637) 2024-01-09 08:14:20 -05:00
__init__.py Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00
alert_rendering.py Fix message is too big exception for mobile push notification (#3556) 2023-12-12 16:46:08 +00:00
auth.py Return API URL as part of status (#2791) 2023-08-22 17:17:26 +00:00
backend.py rename notify_user_async celery task to notify_user_about_new_alert_group (#2900) 2023-08-29 16:02:09 +02:00
demo_push.py Add multi-stack support for mobile app (#3500) 2023-12-13 09:00:18 +00:00
exceptions.py Test mobile push (#1933) 2023-05-18 15:52:42 +08:00
fcm_relay.py Improve FCMDevice.send_message logging (#3527) 2023-12-06 15:47:11 -05:00
models.py Update wording for mobile push notifications timing choices (#3253) 2023-11-02 11:37:28 +00:00
serializers.py Add multi-stack support for mobile app (#3500) 2023-12-13 09:00:18 +00:00
types.py Add backend support for push notification sounds with custom extensions (#2759) 2023-08-07 09:55:17 +00:00
urls.py Return 404 from mobile app gateway viewset (#3518) 2023-12-06 10:57:07 +00:00
utils.py do not retry firebase.messaging.UnregisteredError exceptions for FCM relay tasks (#3637) 2024-01-09 08:14:20 -05:00
views.py Add multi-stack support for mobile app (#3500) 2023-12-13 09:00:18 +00:00