oncall-engine/engine/apps
Joey Orlando 425ffbb740
address mobile device push notification delivery issue when user had > 1 registered device (#2421)
# What this PR does

Address issue where if the user had multiple registered devices w/ FCM,
doing django queries like `.first()` could potentially pick the wrong
device. Do this in two ways:
1. set the `DELETE_INACTIVE_DEVICES` `fcm_django` setting to `True`.
According to the
[docs](20e275618b/README.rst (L127-L130)),
this works as follows:

> devices to which notifications cannot be sent, are deleted upon
receiving error response from FCM
2. Customizing the `FCMDevice` model provided by `fcm_django`. Add a new
method, `get_active_device_for_user`, so that we can centralize the
logic for this rather than duplicating
`FCMDevice.objects.filter(user=user).first()`

## Which issue(s) this PR fixes

https://raintank-corp.slack.com/archives/C0229FD3CE9/p1688461915752119

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required) (N/A)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-07-05 15:14:46 +00:00
..
alerts Remove url from sms notification, change format (#2317) 2023-07-05 16:32:54 +08:00
api Remove test push dynamic setting (#2416) 2023-07-04 15:01:30 +08:00
api_for_grafana_incident add mypy static type checker to backend codebase (#2151) 2023-06-12 12:50:33 -04:00
auth_token re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
base add zvonok integration (#2339) 2023-07-05 05:55:53 +00:00
email Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
grafana_plugin continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
heartbeat Add database migrations linter (#1020) 2023-02-06 16:01:37 +08:00
integrations Fix amv2 2023-06-14 14:43:00 +08:00
metrics_exporter Add "user_was_notified_of_alert_groups" metric (#2334) 2023-06-28 08:15:19 +00:00
mobile_app address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
oss_installation continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
phone_notifications Fix phone call & SMS relay (#2345) 2023-06-26 16:09:21 +00:00
public_api Resolution notes endpoint docs (#2404) 2023-06-29 14:08:21 +00:00
schedules re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
slack fix mypy return errors (#2408) 2023-07-05 11:36:59 +00:00
social_auth Social auth exception logging (#2041) 2023-06-02 11:20:54 +00:00
telegram fix mypy return errors (#2408) 2023-07-05 11:36:59 +00:00
twilioapp fix mypy return errors (#2408) 2023-07-05 11:36:59 +00:00
user_management Add organization moved exception to mobile app auth (#2422) 2023-07-05 06:11:56 +00:00
webhooks re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
zvonok Update CHANGELOG.md 2023-07-05 14:30:51 +08:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00