indicator-datetime starting ringing almost immediately if timer is set in current minute

Bug #1480200 reported by Bartosz Kosiorek on 2015-07-31
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Medium
Alejandro J. Cura
Timer
Undecided
Unassigned
Ubuntu Clock App
Undecided
Unassigned
indicator-datetime (Ubuntu)
Undecided
Unassigned

Bug Description

indicator-datetime doesn't check seconds for alarms.

Reproduce scenario
1. Let's say we have time: 22:00:20
2. If I set Alarm for 22:00:10, then alarm rings immedietely, which is ok.
3. Unfortunately when I set Alarm to 22:00:50, it will also start ringing immedietely

Currently:
4. Alarm is ringing immediately (22:00:20)

Expected:
4. Alarm is ringing after 30 seconds 22:00:50

It is an blocker for Timer implementation in Clock app:
https://bugs.launchpad.net/ubuntu-clock-app/+bug/1427566

Old description:
Steps to reproduce:
1. Install Timer: https://uappexplorer.com/app/timer.mivoligo
2. Set timer to 15 seconds in current minute
3. Start timer

Currently:
4. Alarm is ringing immediately if it is set in current minute

Expected:
4. Alarm is ringing after 15 seconds

description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-datetime (Ubuntu):
status: New → Confirmed
Changed in ubuntu-clock-app (Ubuntu):
status: New → Confirmed
no longer affects: indicator-datetime
Changed in ubuntu-clock-app:
status: New → Incomplete
no longer affects: ubuntu-ui-toolkit
summary: - indicator-datetime doesn't check seconds for alarms
+ indicator-datetime starting ringing almost immedietly if timer is set
+ for less than 60 seconds
Changed in timer:
status: New → Confirmed

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Bartosz Kosiorek (gang65) wrote :
Changed in ubuntu-ui-toolkit (Ubuntu):
status: Confirmed → Invalid
Changed in ubuntu-clock-app (Ubuntu):
status: Confirmed → Invalid
Bartosz Kosiorek (gang65) wrote :

I analyzed this issuevand the ics file is correct. So it is indicator-datetime bug.

no longer affects: ubuntu-clock-app (Ubuntu)
no longer affects: ubuntu-ui-toolkit (Ubuntu)
description: updated
Bartosz Kosiorek (gang65) wrote :

Investigation could be started from:

./src/wakeup-timer-mainloop.cpp: void set_wakeup_time(const DateTime& d)
and also:
./src/alarm-queue-simple.cpp: m_triggered.insert(std::make_pair(appointment.uid, alarm->time));

summary: - indicator-datetime starting ringing almost immedietly if timer is set
+ indicator-datetime starting ringing almost immediately if timer is set
for less than 60 seconds

To be clear, it's not "less than 60 seconds". As the duplicate of this report correctly states, this happens if the alarm is scheduled within the current minute.

summary: indicator-datetime starting ringing almost immediately if timer is set
- for less than 60 seconds
+ in current minute
description: updated
Pat McGowan (pat-mcgowan) wrote :

Is the alarm api appropriate to support timers? or just all we have atm

Changed in canonical-devices-system-image:
assignee: nobody → Pat McGowan (pat-mcgowan)
status: New → Incomplete
Michael Zanetti (mzanetti) wrote :

It's all we have atm. I could imagine it as a timer api but it would probably require better precision (it's off up to 5 seconds in some cases atm) and some other fixes (like calling back the originating app on clicking the notification, instead of the clock app). Also it has the side effect that such timers will show up as alarms in the datetime indicator and iirc the clock app. Both of them are probably questions for design. On the other hand, a proper timer api could offer better features I think. Depends if we want to allow, e.g. focusing/resuming the app when the timer is due so other things could be done instead of just ringing a notification.

Pat McGowan (pat-mcgowan) wrote :

@michael yeah so all of that make using the alarm api for this seem like the wrong approach, and we should provide a proper timer api.

For example see http://developer.android.com/reference/android/os/CountDownTimer.html
or perhaps
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/
or in the meantime uses Qt timers
http://doc.qt.io/qt-4.8/timers.html

I would think to start requiring the app in the foreground is ok for the timer use case, but yeah would like something fancier

The bug should still be fixed.

Changed in canonical-devices-system-image:
status: Incomplete → Confirmed
importance: Undecided → Medium
assignee: Pat McGowan (pat-mcgowan) → Alejandro J. Cura (alecu)
milestone: none → backlog
description: updated
description: updated
Changed in canonical-developer-experience:
status: New → Confirmed
Pat McGowan (pat-mcgowan) wrote :

Opened bug #1583639 for a real API

Changed in canonical-developer-experience:
assignee: nobody → Alejandro J. Cura (alecu)
importance: Undecided → Medium
no longer affects: canonical-developer-experience
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments