Updated recurring alarm values are not reflected in the indicator until phone reboot

Bug #1283859 reported by Nekhelesh Ramananthan
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Indicator Date and Time
Invalid
Undecided
Unassigned
Ubuntu Clock App
Fix Released
Undecided
Renato Araujo Oliveira Filho
Ubuntu UI Toolkit
Invalid
Undecided
Unassigned
qtorganizer5-eds (Ubuntu)
Fix Released
Undecided
Renato Araujo Oliveira Filho

Bug Description

Mako 205

Steps to reproduce:
1. Create a recurring alarm and save it
2. Select the saved alarm to go to edit mode
3. Change the time, day of the alarm or status of the alarm.
4. Hit save

What happens:
The alarm is correctly updated in the clock app. The indicator however still shows the old alarm time

What should happen:
The alarm is correctly updated *both* in the clock app and the indicator.

If you however reboot the phone, the indicator then shows the updated recurring alarm time.

Related branches

affects: qtorganizer5-eds → qtorganizer5-eds (Ubuntu)
Revision history for this message
Charles Kerr (charlesk) wrote :

Okay, after a bit of digging I think what we need to do is remove the "event.setDueDateTime(alarm.date);" line from ubuntu-ui-toolkit's AlarmsAdapter::organizerEventFromAlarmData().

Here's an abbreviated example of a vtodo written to tasks.ics by ubuntu-clock-app --> ubuntu-ui-toolkit --> qtorganizer5-eds:

    BEGIN:VCALENDAR^M
    CALSCALE:GREGORIAN^M
    PRODID:-//Ximian//NONSGML Evolution Calendar//EN^M
    VERSION:2.0^M
    X-EVOLUTION-DATA-REVISION:2014-02-25T04:39:19.361663Z(2)^M
    BEGIN:VTODO^M
    UID:20140225T043915Z-3142-32011-1543-9@ubuntu-phablet^M
    DTSTAMP:20140225T043915Z^M
    DTSTART:20140224T060000^M
    DUE:20140224T060000^M
    RRULE;X-EVOLUTION-ENDDATE=19700101T000000Z:FREQ=DAILY;COUNT=-1^M
    SUMMARY:Alarm^M
    CREATED:20140225T043915Z^M
    END:VTODO^M
    END:VCALENDAR^M

indicator-datetime tries to find calendar events within a certain time window by using e_cal_client_generate_instances(), which doesn't find the above VTODO when searching in the date range [2014-02-24 22:52:33...2014-03-24 22:52:33]

e_cal_util_get_component_occur_times() (in evolution-data-server-3.10.1/calendar/libecale-cal-util.c) has a special rule for VTODO items, looking for the ending range by taking the higher value of "completed" or "due":

    > if (kind == ICAL_VTODO_COMPONENT) {
    > ....
    > e_cal_component_get_completed (comp, &tt);
    > ....
    > e_cal_component_get_due (comp, &dt_due);
    > ....
    > max_time = MAX (completed_time, due_time);

Since "completed" isn't set, EDS returns "due" as the end.

"due" comes from qtorganizer5-eds's qorganizer/qorganizer-eds-engine.cpp's QOrganizerEDSEngine::parseDueDate()'s call to e_cal_component_free_datetime().

That call appears to come from ubuntu-ui-toolkit's modules/Components/plugin/adapters/alarmsadapter_organizer.cpp's AlarmsAdapter::organizerEventFromAlarmData() function calling "event.setDueDateTime(alarm.date);"

If you remove the single line "DUE" from the above VTODO, e_cal_client_generate_instances() is able to find it using the same date range mentioned above.

Revision history for this message
Zsombor Egri (zsombi) wrote :

Alarms fetched in Alarms API are getting their date from the due date, which is the due date of the next occurrence. The question is whether I get a proper date at fetch time if I do not set the due date for the original event. Or is the due date for the individual occurrences set independently from the original event's due date? If yes, we can make the change in UITK Alarms API.

Revision history for this message
Zsombor Egri (zsombi) wrote :

Ahh, sorry, my comments are on the wrong bug :) Let me check if I can get rid of the dueDate() and rely only on startDate()

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in qtorganizer5-eds (Ubuntu):
status: New → Confirmed
Changed in ubuntu-clock-app:
milestone: 1.8 → 2.0
Revision history for this message
Charles Kerr (charlesk) wrote :

Still present in r276.

I'm testing this out on r276 this morning and am getting confusing results. At first I thought it was an indicator-datetime caching bug, because the modified alarms are being successfully saved to tasks.ics.

However, even if I stop and restart indicator-datetime, the new session of indicator-datetime picks up the old values instead of the updated ones seen in tasks.ics. I added in debug statements to check the timestamps, and yes alarms being returned by indicator-datetime's call to e_cal_client_generate_instances() still have the old values.

However, if I kill and restart evolution-calendar-factory, *then* restart indicator-datetime, it picks up the new, modified versions.

The system is behaving like there's a cached version of the alarms in evolution-calendar-factory that's not getting updated after tasks.ics gets written out after qtorganizer5-eds modifies the objects.

Renato, Zsombor, any ideas on this?

Revision history for this message
Charles Kerr (charlesk) wrote :

Steps I used to test this:

1. ssh'ed into the phablet

2. built lp:~charlesk/indicator-datetime/log-instances-to-terminal, which is stock indicator-datetime plus this console message: http://bazaar.launchpad.net/~charlesk/indicator-datetime/log-instances-to-terminal/revision/337

3. "$ stop indicator-datetime" to kill the system copy of indicator-datetime

4. "$ log-instances-to-terminal/build/src/indicator-datetime-service" to start up the test build to run in its place

What happens:

The times returned by e_cal_client_generate_instances() get dumped to the terminal and match the alarms' old values, instead of the new ones, until I kill evolution-calendar-factory and restart.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

@nick90, @charles, could you test my branch?
Looks like the problem is related with the update mode used during the event save.

Changed in qtorganizer5-eds (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Renato Araujo Oliveira Filho (renatofilho)
Revision history for this message
Charles Kerr (charlesk) wrote :

Renato, yes! lp:~renatofilho/qtorganizer5-eds/fix-1283859 fixes this for the test I described in comments #5 and #6 :D

Changed in indicator-datetime:
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtorganizer5-eds - 0.1.1+14.04.20140415.1-0ubuntu1

---------------
qtorganizer5-eds (0.1.1+14.04.20140415.1-0ubuntu1) trusty; urgency=low

  [ Renato Araujo Oliveira Filho ]
  * Optimize eventid parse, and avoid memory leak. (LP: #1306112)
  * Used alarm component description as message field for visual
    reminders. (LP: #1284375)
  * Implemented support to update recurrence items with different modes.
    All (E_CAL_OBJ_MOD_ALL);. A single instance (E_CAL_OBJ_MOD_THIS),. A
    specific set of instances (E_CAL_OBJ_MOD_THIS_AND_PRIOR and
    E_CAL_OBJ_MOD_THIS_AND_FUTURE) (LP: #1283859)
  * Fixed recurrence date limit parse. (LP: #1292554)
  * Removed all debug messages. (LP: #1294426)
 -- Ubuntu daily release <email address hidden> Tue, 15 Apr 2014 19:43:13 +0000

Changed in qtorganizer5-eds (Ubuntu):
status: In Progress → Fix Released
Changed in ubuntu-clock-app:
status: Confirmed → Invalid
Changed in ubuntu-ui-toolkit:
status: New → Invalid
Changed in ubuntu-clock-app:
milestone: 2.0 → alarm-blockers
importance: High → Undecided
Changed in ubuntu-clock-app:
status: Invalid → Fix Released
Changed in ubuntu-clock-app:
milestone: alarm-blockers → rtm
Changed in ubuntu-clock-app:
assignee: nobody → Renato Araujo Oliveira Filho (renatofilho)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.