oncall-engine/engine
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
..
apps address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
common continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
config_integrations Grouping templating polishing10 (#2276) 2023-06-20 12:47:54 +00:00
engine add zvonok integration (#2339) 2023-07-05 05:55:53 +00:00
settings address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
static/images World, meet OnCall! 2022-06-03 08:09:47 -06:00
type_stubs/icalendar continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
.dockerignore One startup command to rule them all (#760) 2022-11-07 16:34:43 +01:00
.gitignore modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
celery_with_exporter.sh Add flag to debug logs (#912) 2022-11-29 11:16:42 +08:00
conftest.py remove SlackActionRecord model/table (#2201) 2023-06-13 10:56:06 +00:00
Dockerfile install requirements-dev.txt dependencies oncall docker image dev target (#2284) 2023-06-19 05:50:59 -04:00
manage.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
pyproject.toml fix mypy return errors (#2408) 2023-07-05 11:36:59 +00:00
requirements-dev.txt re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
requirements.txt add user locale field to mobile app user settings table + change going on call push notification text (#2131) 2023-06-14 12:19:58 -04:00
tox.ini Fix duplicate orders for user notification policies (#2278) 2023-06-21 11:13:56 +00:00
uwsgi.ini Run containers as a non-root user (#2053) 2023-06-08 07:12:00 +00:00
wait_for_test_mysql_start.sh Revert "Revert "speed up ci builds from 15 to <7 minutes"" (#1643) 2023-03-28 09:34:03 +02:00