oncall-engine/engine/apps/mobile_app/tests
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
..
__init__.py Enforce cloud connection to send push notifications on OSS (#1132) 2023-01-19 11:15:56 +00:00
test_demo_push.py address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
test_fcm_device_model.py address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
test_fcm_relay.py address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
test_mobile_app_auth_token.py add unique idx on user column in mobileapp authtoken table (#1482) 2023-03-08 13:50:57 +01:00
test_notify_user.py address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00
test_user_settings.py 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
test_your_going_oncall_notification.py address mobile device push notification delivery issue when user had > 1 registered device (#2421) 2023-07-05 15:14:46 +00:00