SimpleMobileTools/Simple-Clock

Missed alarm will secretly disable alarm

UPBT opened this issue · 2 comments

UPBT commented

Steps to reproduce

  1. assume an alarm for 4 PM to remind you to take a pill or something
  2. You miss hearing the alarm because you are away from your phone.
  3. the app leaves a "notification" which you see and clear at 8 PM.
  4. The next day, your 4 PM alarm does not go off.

Expected behavior: Alarm goes off as programmed

Work Around any alarm disabled by this action can be re-enabled by unchecking and rechecking the "enable" checkbox. There is absolutely no indication that the alarm is disabled except when it does not go off as scheduled, so a user is expected to remember that they missed an alarm and must reset the alarm manually.

App version 5.10.3 on Android 10 via F-droid

pudup commented

This bug can somewhat be reproduced in a different way.

If an alarm goes off and you press home, the alarm will continue going off in the background. If you clear the notification away it will be impossible to stop the alarm at that point barring one way. The one way to stop the alarm is to close the clock app from recents. Doing this prevents the next alarm from being scheduled and you'll have to disable and enable the alarm.

The notification for the alarm should prolly changed to an "Ongoing" notification.

I think I found the issue.

The function snoozeAlarm() does not handle the case of the "Missed Alarm" in the else block (lines 274 - 281) shown below.
In the case of the "Missed Alarm" the user does nothing when the dialog appears.

} else {
showPickSecondsDialog(config.snoozeTime * MINUTE_SECONDS, true, cancelCallback = { finishActivity() }) {
config.snoozeTime = it / MINUTE_SECONDS
setupAlarmClock(alarm!!, it)
wasAlarmSnoozed = true
finishActivity()
}
}