Enabling alarm after midnight schedules it for the next day
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Ubuntu Clock App |
High
|
themeles | ||
Bug Description
If it's past midnight, and you enable one of your saved alarm, it won't ring on the same day but the day after that.
For example:
- It's 01h30 in the night.
- You enable your saved alarm which is at 06h30
- The widget shows "In 29h" instead of "In 5h"
Steps to almost reliably reproduce the bug:
1. Create an alarm for 10:00 AM and disable it
2. Close clock app
3. Manually change the system date to the next day and also set the time as 01:00 AM (any time before 10:00 AM)
4. Open clock app
5. Enable alarm created in step 1
At the point when the alarm is enabled it should show that the alarm is schedule to ring for today and not tomorrow.
Related branches
- Ubuntu Phone Apps Jenkins Bot: Approve (continuous-integration) on 2015-06-14
- Nekhelesh Ramananthan: Approve on 2015-06-14
-
Diff: 54 lines (+12/-10)3 files modifiedapp/alarm/AlarmDelegate.qml (+7/-8)
debian/changelog (+4/-1)
po/com.ubuntu.clock.pot (+1/-1)
| Changed in ubuntu-clock-app: | |
| status: | New → Confirmed |
| Changed in ubuntu-clock-app: | |
| importance: | Undecided → High |
| milestone: | none → 3.3 |
| Joni Arida (joni-arida) wrote : | #2 |
When you switch on the alarm it is written he will ring in more the one day. I add a screenshot to thos comment!
| themeles (themeles) wrote : | #3 |
Exactly the same issue here.
| Torsten Sachse (torsten-sachse) wrote : | #4 |
I am suffering from the same issue which happens to me every day. Version 3.3.192 on a BQ on r22.
| themeles (themeles) wrote : | #5 |
I just did some test. I set my timezone to Senegal (=UTC), set the time to 00:48 and then I went to the Alarm clock and activated all my alarms. The resut:
08:30 Alarm passed
06:47 Alarm passed
06:10 Alarm passed
06:20 Alarm passed
07:10 1 day 6 hours and 21 minutes
07:35 1 day 6 hours and 46 minutes
07:00 1 day 6 hours and 10 minutes
none of them were set correctly. And none has a limitation to a certain day.
| themeles (themeles) wrote : | #6 |
I was messing around with this bug again and I found the following rule:
* Alarm created on the 1st of the month -> OK
* Alarm set again (just with the switch) on the 2nd -> ERROR
* Alarm set again (just with the switch) on the 3rd -> OK if it has been activated with the switch on the 2nd
* Alarm set again (just with the switch) on the 5th (!) -> ERROR, because it has not been activated on the 4th
* Alarm set again (just with the switch) on the 5th (!) -> ERROR ("Alarm passed")
I think this issue could be fixed if the date is set to undefined as soon as the alarm gets deactivated.
| Changed in ubuntu-clock-app: | |
| status: | Confirmed → In Progress |
| assignee: | nobody → Nekhelesh Ramananthan (nik90) |
| Nekhelesh Ramananthan (nik90) wrote : | #7 |
@users who are affected by this bug, we might have a potential fix thanks to the help of themeles. Please help us validate the fix.
Steps to test:
1. Download the click package attached to this comment
2. Connect your 15.04 vivid phone to the computer.
3. Push the click package from your computer to the phone by running, " adb push com.ubuntu.
4. Install click package by running, " pkcon install-local --allow-untrusted /tmp/com.
5. Test if it fixes the bug.
Thanks for your help.
| Changed in ubuntu-clock-app: | |
| assignee: | Nekhelesh Ramananthan (nik90) → themeles (themeles) |
Fix committed into lp:ubuntu-clock-app at revision 279, scheduled for release in ubuntu-clock-app, milestone 3.3
| Changed in ubuntu-clock-app: | |
| status: | In Progress → Fix Committed |
| description: | updated |
| Changed in ubuntu-clock-app: | |
| status: | Fix Committed → Fix Released |


Hum, it's weird because the code *looks* correct:
``` active_ alarm(alarmMode l, clockTime) {
function _get_next_
var activeAlarmDate = undefined
for (var i=0; i<alarmModel.count; i++) { enabled && currentAlarm.date > clockTime) {
currentAlarm .date < activeAlarmDate) {
activeAla rmDate = currentAlarm.date
var currentAlarm = alarmModel.get(i)
if (currentAlarm.
if (activeAlarmDate === undefined ||
}
}
}
return activeAlarmDate
}
```