oncall-engine/engine/apps/mobile_app/tests
Joey Orlando aa0d4468db
Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872)
# Which issue(s) this PR fixes

So because of how we run the task that sends the "You're going oncall"
push notifications, there are sometimes rounding "errors" in the
displayed text of the push notification. For example, if you've
configured your mobile app to remind you 12h before your on-call shift
starts it sometimes might say:

> You're going oncall in 11 hours

This is because of the [background task being executed every
10mins](https://github.com/grafana/oncall/blob/dev/engine/settings/base.py#L545-L548)
and us continually checking if now is the appropriate time to send the
notification (we took this approach because we don't have any easy way
of emitting an event exactly when a shift starts.. yay ical).

This PR corrects that by rounding to the closest configuration value
that we allow.

## 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-02-09 15:31:34 -05:00
..
tasks Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872) 2024-02-09 15:31:34 -05:00
__init__.py Enforce cloud connection to send push notifications on OSS (#1132) 2023-01-19 11:15:56 +00:00
test_alert_rendering.py make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05:00
test_demo_push.py Add multi-stack support for mobile app (#3500) 2023-12-13 09:00:18 +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_endpoint.py Add multi-stack support for mobile app (#3500) 2023-12-13 09:00:18 +00:00
test_fcm_relay.py refactor apps.mobile_app.tasks into individual task files (#2888) 2023-08-29 11:34:09 +02:00
test_mobile_app_auth_token.py Add multi-stack support for mobile app (#3500) 2023-12-13 09:00:18 +00:00
test_mobile_app_gateway.py remove iat and exp from auth api token claims 2024-01-25 15:14:08 -05:00
test_user_settings.py "Going oncall" notification settings (#3187) 2023-10-30 13:44:18 +00:00
test_utils.py do not retry firebase.messaging.UnregisteredError exceptions for FCM relay tasks (#3637) 2024-01-09 08:14:20 -05:00