Friday Jan 30, 2009

VTODO with DUE date in Lightning

Lightning 0.9 also let you create VTODOs (Tasks) and store them on a CalDAV Server. By default those tasks have no associated dates but one can add a due date + time:

Here is how such a task is stored on the CalDAV server:


The VTODO component has a correct DUE property and no DTSTART.

If one tries to add an alarm to this task (trigger -15 minutes before), the start time of the task which was unset becomes auto selected and can not be removed (although it can be changed):

Here is how the VTODO is stored on the CalDAV Server:

DESCRIPTION:Mozilla Alarm: New Task

Here again, the TRIGGER property is missing a RELATED=END parameter to indicate that the alarm is relative to the due date. Instead, a DTSTART was added, "without the user's consent".

In addition, given that the DTSTART value is equal to the DUE value, this component is valid per RFC2445 but invalid per the new calsify spec where the DUE value must be later in time than the value of the DTSTART.

I should have started by stating that I'm not trying to put any judgment on the quality of one implementation over another but rather to see how todos with due date are used by clients, how they can interoperate, and maybe help future client implementations.

Monday Sep 24, 2007

Calconnect discussion: use of VALARM in clients: dismiss versus snooze (continued)

More on alarms (see previous post):

Snoozing an alarm - non recurring event:

It first striked me that snoozing an alarm was a pure client issue. I "snooze" a lot but in general, it is to be pinged again 1 minute before the beginning of a meeting. Apparently, other people are snoozing for much longer periods of time (e.g. one day). And indeed some popular calendar clients offer options to snooze for up to several weeks. So maybe in this type of scenario the information should be propagated to the server after all.

One simple solution is for the client to change the TRIGGER property of the corresponding VALARM to the new value (either relative or absolute) and propagate that change to the Server. A problem with changing the TRIGGER property on each snooze is that this may lead to pretty funky TRIGGER values. When displaying the event, those funky values will be displayed to the end user.
Another solution is to add an extra VALARM with a TRIGGER expressed in absolute time. This is correct from a standard point of view, but how will clients react to having multiple display alarms ? Something to experiment...
Yet another solution would be to keep the TRIGGER as is and to add a yet to be defined SNOOZEUNTIL property containing the datetime of the next time the alarm should be fired. This is what Lightning seems to be doing with their X-MOZ-SNOOZE-TIME property. Weirdly enough, this X- property is not part of the VALARM component but it is part of the main component. The advantage of this approach is that it is less likely to break existing clients.

 My preference would be to use extra VALARM to convey the snooze information as it should work today across clients.

Snoozing an alarm - recurring event: 

Out of the 3 solutions presented above for non recurring events, only the second and third make sense in the context of recurring events as the first solution (change the TRIGGER) would translate to changing the TRIGGER value for all the upcoming instances of the event. Creating an exception every time the user wants to snooze would not be acceptable either.

One thing to note about the 2 other solutions is that if multiple instances get snoozed, there is no link between the instance that triggered the original alarm and whatever information we add (SNOOZEUNTIL property or VALARM) to indicate that the alarm was snoozed. For example, if I have a recurring weekly meeting, I snooze the alarm on the first instance for 5 more weeks, then one week later, I snooze the alarm of the second instance for 1 more week. I will end up with 2 SNOOZEUNTIL properties or 2 VALARM components but I have no way of knowing which instance triggered them to be added. But do we really care ?...

Sunday Sep 23, 2007

Calconnect discussion: use of VALARM in clients: dismiss versus snooze

An interesting discussion happened during the Calconnect meeting, regarding alarms. The following post does not reflect the whole discussion but simply my understanding and experience with dealing with the problems that were raised.

Most desktop calendar clients (and now some web based calendar clients) will let you set display alarms.
The alarm is usually relative to the start of the event (e.g. 15 minutes before the beginning of a meeting). It can be dismissed or "snoozed" i.e. moved to a later time ("remind me again in 5 minutes").

On the standard size, the iCalendar specification lets you:

  • associate as many VALARMs as you want with a VEVENT or VTODO,

  • specify a TRIGGER time that can be an absolute time (e.g. "20070917T160000Z") or an offset (e.g. -PT30M) from the event's start or end,

  • create repeating alarms. 

In a client/server model using iCalendar as the data representation and regardless of the protocol (CalDAV, WCAP, the protocol previously known as SyncML,...), what does it mean to fire, dismiss or snooze a display alarm ?

(In the following, the client can be either a desktop application or a phone/PDA. In the case of a desktop application, the client being "turned on" really means that the application is launched).

When to fire a display alarm: 

If the client is turned on, the response is quite obvious: it should fire the display alarm as indicated by the TRIGGER property of the VALARM component (there might be several of them and they may be repeating).

But what if the client was not turned on at the time it should have triggered the alarm ?

The consensus seems to be that the client should trigger the alarm whenever it goes back on, even if it is after the start/end of the event. That way, the end user is notified that he may have missed something important. Of course, whenever possible, a client should offer a way to "Dismiss All" alarms so as to avoid having to acknowledge dozens of alarms when coming back from an extended leave.

Dismissing an alarm - non recurring event: 

This is the most simple case: the client "should" (using quotes as this is not mandated by any protocol AFAIK) remove the corresponding VALARM component from the server's copy so that other clients (or the same client after a restart) doesn't fire the alarm again. This is a relatively lightweight operation in the case of WCAP, a little bit more heavyweight in the case of CalDAV/PPKASyncML as the whole iCalendar object (VEVENT, VTODO) needs to be transmitted back to the Server.

When multiple clients are in use (or at least running) at the same time, those clients should try to detect such a change on the server and act accordingly. For example, let's imagine a user with a desktop and a laptop, both running his favorite calendar client. Both clients are turned on and hence, both display alarm messages regarding the same set of events. Now, from his laptop, the user dismisses one alarm. This will trigger a change on the server (removal of the VALARM). If well behaved, the calendar application on the desktop should detect this change on its next sync with the server and remove the display alarm from the user's view. 

Dismissing an alarm - recurring event:

As usual, this is where it gets harder:

  • Completely removing the VALARM on dismiss would correspond to not having any alarm for all the upcoming instances of the recurring event... Definitely not what the end user wants to do
  • Adding a VEVENT exception with no VALARM each time the user dismiss once instance would be very dangerous in terms of performance, usability and interoperability.
  • Not acting on the representation of the alarm means that on the next restart, the client will have no way of knowing whether it should display the last past alarm or the next scheduled one.


The Mozilla Lightning project is using an X- property (X-MOZ-LASTACK) containing a timestamp to keep track of the last time the alarm was dismissed (acknowledged). This X- property is part of the VALARM component. Using this X- property, clients can simply determine that only the next instance of the TRIGGER coming after the timestamp should be considered for display.
There seemed to be a consensus at Calconnect that standardizing this property would probably make sense.

Lightning seems to also use this X- property for non recurring events. This has the advantage that the VALARM information can be kept within the component. If the event is "moved forward" the alarm can be triggered again. On the other hand, this means that all the other clients that are not aware of this X- prop (i.e. as of today most of them) will consider that the alarm has not been dismissed. So until this property becomes standardized, I think it is better from an interop point of view to just remove the VALARM component of non recurring events when dismissing them.

Wednesday Jun 06, 2007

new wcap based server

Several calendar server projects have added (partial) support for Sun WCAP protocol. The latest I have found (here) is the Fin Calendar Server. While WCAP has been around for almost 10 years, those alternative implementations have started to appear only recently.

The fact that several fat calendar clients (Sun Outlook Connector, Thunderbird + Lightning, Evolution, Kontact, ...) are now WCAP aware is probably the main reason for this sudden interest. Its very simple design makes it also quite easy to understand and implement.



« July 2016