Skip to content

Commit

Permalink
Remove user defined time period from "you're going oncall" mobile push (
Browse files Browse the repository at this point in the history
#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)
  • Loading branch information
iskhakov authored May 24, 2023
1 parent 36f7ec2 commit d139fcc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion engine/apps/mobile_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit d139fcc

Please sign in to comment.