Closed Bug 415987 Opened 16 years ago Closed 16 years ago

FREEBUSY decoding does not support comma-separated entries

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: WSourdeau, Assigned: dbo)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.8.1.11) Gecko/20071128 Iceweasel/2.0.0.11 (Debian-2.0.0.11-1)
Build Identifier: Lightning 0.7  build 2007102303

While looping with the following code to retrieve the FREEBUSY entries:

var ics = Components.classes["@mozilla.org/calendar/ics-service;1"]
 	.getService(Components.interfaces.calIICSService);
var cal = ics.parseICS(fbText);
var vfb = cal.getFirstSubcomponent("VFREEBUSY");

var done = false;
while (!done) {
  var fb;
  if (count < 1)
    fb = vfb.getFirstProperty("FREEBUSY");
  else
    fb = vfb.getNextProperty("FREEBUSY");
  if (fb) doSomeThingNice...;
  else
    done = true;
}

... "FREEBUSY" properties specified as this:
FREEBUSY;FBTYPE=BUSY:20080206T160000Z/PT1H,20080206T180000Z/PT1H,20080206T
 200000Z/PT1H,20080206T220000Z/PT1H,20080207T000000Z/PT1H

are never found. Instead, I have to work-around this by splitting the value and reinserting corresponding single entries:

FREEBUSY;FBTYPE=BUSY:20080206T160000Z/PT1H
FREEBUSY;FBTYPE=BUSY:20080206T180000Z/PT1H
FREEBUSY;FBTYPE=BUSY:20080206T200000Z/PT1H
FREEBUSY;FBTYPE=BUSY:20080206T220000Z/PT1H
FREEBUSY;FBTYPE=BUSY:20080207T000000Z/PT1H

This looks like there is a bug in the ICS parser...

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
OS: Linux → All
Version: unspecified → Lightning 0.7
Attached patch suggested fix in libical (obsolete) — Splinter Review
I can imagine this is the same bug that I've fixed with EXDATE/RDATE lists in libical's parser code.
Wolfgang, could you please check out this simple patch whether it fixes your problem?
Status: UNCONFIRMED → NEW
Ever confirmed: true
I don't know if I will have the time to rebuild the package. I'll keep you posted.
Please note that we are right before 0.8 RC1. So it's getting soon harder to get fixes in.
The problem is that I have plenty of work and I am a bit reluctant to uncompress, setup the whole mozilla build environment and build Lightning just to test this.
Would it possible for you to test it instead? I could provide you with an .ifb file which causes the bug and another which doesn't...
Attached patch fixSplinter Review
Fix including a basic unit test.
Assignee: nobody → daniel.boelzle
Attachment #301792 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #302003 - Flags: review?(philipp)
Flags: wanted-calendar0.8+
Flags: in-testsuite+
Target Milestone: --- → 0.8
Version: Lightning 0.7 → unspecified
Comment on attachment 302003 [details] [diff] [review]
fix

Looks good, r=philipp

I'm not sure if there are any implications on changing libical, especially since it is updated on trunk and not on branch?
Comment on attachment 302003 [details] [diff] [review]
fix

r+ per comment #6

Checked in on HEAD and MOZILLA_1_8_BRANCH.

I'll leave a comment in bug 394902 about this bug.
Attachment #302003 - Flags: review?(philipp) → review+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.