oncall-engine/engine/apps/mobile_app
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
..
migrations Fix db migration for mobile app (#3260) 2023-11-02 16:40:26 +00: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
tests 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 Mobile app messaging backend (#874) 2022-11-23 15:56:43 +00:00
alert_rendering.py make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05:00
auth.py Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
backend.py make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05: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 Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872) 2024-02-09 15:31:34 -05: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 Add missing notification log records (#3664) 2024-01-12 14:02:44 +00:00
views.py add some more logging to mobile app proxy 2024-01-26 10:48:35 -05:00