[CalendarServer-dev] Unbound RRULE rewritten to COUNT=400

Cyrus Daboo cdaboo at apple.com
Wed Jul 1 07:31:19 PDT 2009


Hi Helge,

--On July 1, 2009 4:20:31 PM +0200 Helge Heß <me at helgehess.eu> wrote:

> when I save an unbound RRULE, CalendarServer seems to rewrite it to a
> bound RRULE with a constant count of 400.
>
> Why is that? Does CalServer flatten RRULEs somewhere?
>
> I wonder whether its appropriate to convert a COUNT=400 to unlimited on
> import ... (should there be an X-CAL-SERVER-COUNT property instead?)

We deliberately truncate unbounded RRULEs that would generate too many 
instances in our index for performance reasons. The basic policy is this:

1) For an unbounded RRULE with FREQ equal to anything other than YEARLY we 
add COUNT=400.
2) For a bounded RRULE with a COUNT greater than 400, we set COUNT=400.
3) For a bounded RRULE with an UNTIL we attempt to determine the number of 
instances up to the UNTIL value (using a fast, but not absolutely accurate, 
method based on frequency and period). If instances exceed 400 we remove 
the UNTIL and add COUNT=400.

There are still some tweaks we are thinking about here. In particular it 
has been suggested that rather than doing a COUNT truncation, what we 
should do is set UNTIL to the end of the year after the year in the DTSTART 
- i.e. allow at least one whole year's worth of bookings.

At some point we may also revise our indexing to remove the performance 
issue at which point truncation may not be needed - but for now it is 
better to do it.

-- 
Cyrus Daboo



More information about the calendarserver-dev mailing list