Mailing List Archive

Bug in event expansion
Hi all,

I think I've spotted a bug on expanded event queries.

Excuse me for using some inaccurate terms, I'll try to use the correct
ones.

I have a calendar with some events, and one of them has a rrule like this:

RRULE:FREQ=WEEKLY;UNTIL=20090330T060000Z;INTERVAL=1;BYDAY=MO

If I fetch its calendar object by UID, I get 4 components, 3 of them
have a 'RECURRING-ID' defined. To be more specific, the 4 components
have the following relevant properties:

--8<--
#1
DTSTART:20090126T080000Z

#2 [.this one has only a little change on other additional properties,
not in start nor end time]
RECURRENCE-ID:20090302T080000Z
DTSTART:20090302T080000Z

#3 [Event is 4 hours later than expected in recurring event]
RECURRENCE-ID:20090309T080000Z
DTSTART:20090309T120000Z

#4 [Event is 1 hour earlier than expected in recurring event]
RECURRENCE-ID:20090323T080000Z
DTSTART:20090323T070000Z
-->8--

Ok, so if I do a query with 'expand' for March of 2009, I only get the
event for the not-modified day (16th of March), but not for any of the
other days. With a CalDAV client like Sunbird I get all events as
expected (I think it doesn't use expanding).

So I have analyzed the code of RRule-v2.php and I have found the
problem. I have attached a simple patch that corrects the issue, as it
seems that original code removes overriden instances, but doesn't add
the instances that have RECURRENCE-ID set.

Please, take a look at it and consider applying it.

Regards.

--
Jorge L?pez P?rez
http://adobo.org
xmpp:jorge at im.jepsi.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: davical-expand.patch
URL: <http://lists.davical.org/pipermail/davical-dev/attachments/20110430/b44779da/attachment.txt>
Bug in event expansion [ In reply to ]
On Sat, 2011-04-30 at 19:17 +0200, Jorge L?pez P?rez wrote:
> Hi all,
>
> I think I've spotted a bug on expanded event queries.
>
> Excuse me for using some inaccurate terms, I'll try to use the correct
> ones.
>
> I have a calendar with some events, and one of them has a rrule like this:
>
> RRULE:FREQ=WEEKLY;UNTIL=20090330T060000Z;INTERVAL=1;BYDAY=MO
>
> If I fetch its calendar object by UID, I get 4 components, 3 of them
> have a 'RECURRING-ID' defined. To be more specific, the 4 components
> have the following relevant properties:
>
> --8<--
> #1
> DTSTART:20090126T080000Z
>
> #2 [.this one has only a little change on other additional properties,
> not in start nor end time]
> RECURRENCE-ID:20090302T080000Z
> DTSTART:20090302T080000Z
>
> #3 [Event is 4 hours later than expected in recurring event]
> RECURRENCE-ID:20090309T080000Z
> DTSTART:20090309T120000Z
>
> #4 [Event is 1 hour earlier than expected in recurring event]
> RECURRENCE-ID:20090323T080000Z
> DTSTART:20090323T070000Z
> -->8--
>
> Ok, so if I do a query with 'expand' for March of 2009, I only get the
> event for the not-modified day (16th of March), but not for any of the
> other days. With a CalDAV client like Sunbird I get all events as
> expected (I think it doesn't use expanding).
>
> So I have analyzed the code of RRule-v2.php and I have found the
> problem. I have attached a simple patch that corrects the issue, as it
> seems that original code removes overriden instances, but doesn't add
> the instances that have RECURRENCE-ID set.
>
> Please, take a look at it and consider applying it.

Hi Jorge,

This patch looks interesting, and I know there are some issues in this
area, but the code has also changed quite a bit in Git since the version
you wrote the patch against :-(

In particular, in Git it calculates the DTSTART relevant to the type of
component being processed (VTODO, VEVENT, etc).

Is it possible for you to redo the patch against current HEAD?

Thanks,
Andrew.

--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
Record additional transactions on back of previous stub.
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.davical.org/pipermail/davical-dev/attachments/20110513/830f3367/attachment.pgp>