From d139fcc7e80cf70b2b39131b9b1c1ef414d27489 Mon Sep 17 00:00:00 2001 From: Ildar Iskhakov Date: Wed, 24 May 2023 16:14:48 +0800 Subject: [PATCH] Remove user defined time period from "you're going oncall" mobile push (#2001) # What this PR does ## Which issue(s) this PR fixes ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- CHANGELOG.md | 1 + engine/apps/mobile_app/tasks.py | 4 +++- .../mobile_app/tests/test_your_going_oncall_notification.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d10f341b..7075d04b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix SQLite permission issue by @vadimkerr ([#1984](https://github.com/grafana/oncall/pull/1984)) +- Remove user defined time period from "you're going oncall" mobile push ([2001](https://github.com/grafana/oncall/pull/2001)) ## v1.2.26 (2023-05-18) diff --git a/engine/apps/mobile_app/tasks.py b/engine/apps/mobile_app/tasks.py index 70058499..fafe06a9 100644 --- a/engine/apps/mobile_app/tasks.py +++ b/engine/apps/mobile_app/tasks.py @@ -383,7 +383,9 @@ def should_we_send_going_oncall_push_notification( f"shift_starts_within_fifteen_minutes: {shift_starts_within_fifteen_minutes}" ) - if shift_starts_within_users_notification_timing_preference or shift_starts_within_fifteen_minutes: + # Temporary remove `shift_starts_within_users_notification_timing_preference` from condition to send notification only 15 minutes before the shift starts + # TODO: Return it once mobile app ready and default value is changed (https://github.com/grafana/oncall/issues/1999) + if shift_starts_within_fifteen_minutes: logger.info(f"timing is right to send going oncall push notification\n{timing_logging_msg}") return seconds_until_shift_starts logger.info(f"timing is not right to send going oncall push notification\n{timing_logging_msg}") diff --git a/engine/apps/mobile_app/tests/test_your_going_oncall_notification.py b/engine/apps/mobile_app/tests/test_your_going_oncall_notification.py index fde76af7..9cd99a03 100644 --- a/engine/apps/mobile_app/tests/test_your_going_oncall_notification.py +++ b/engine/apps/mobile_app/tests/test_your_going_oncall_notification.py @@ -64,7 +64,7 @@ def test_shift_starts_within_range(timing_window_lower, timing_window_upper, sec timezone.datetime(2022, 5, 2, 12, 5, 0), ONE_HOUR_IN_SECONDS, timezone.datetime(2022, 5, 2, 13, 12, 0), - 67 * 60, + None, ), ( False, @@ -79,7 +79,7 @@ def test_shift_starts_within_range(timing_window_lower, timing_window_upper, sec timezone.datetime(2022, 5, 2, 12, 5, 0), ONE_HOUR_IN_SECONDS, timezone.datetime(2022, 5, 2, 12, 58, 0), - 53 * 60, + None, ), ( False,