Skip to content

Filing a (good) bug report

Rian Stockbower edited this page Sep 3, 2016 · 3 revisions

Information to include

  • Nuget version: What version of the nuget package are you using? Did you update to the latest version? Sometimes I publish multiple nuget versions in a single day. Point releases typically contain one or more bugfixes, usually reported by people like you.
  • Describe the observed behavior: "Occurrences happened at the same time every day"
  • Describe the expected behavior: "I expected the occurrence on [date] to have a time of [time]"
  • A way to reproduce the problem: VCALENDAR or VEVENT text often shows what you're describing in words, and can be incorporated into a future unit test to make sure the problem doesn't resurface later.

Example

RDATEs aren't being evaluated as part of a recurrence rule set. I would expect occurrences every day at 8am, except for Aug 30 when the occurrence should be at 10am.

I'm using version 2.2.11 from nuget.

BEGIN:VCALENDAR
PRODID:-//ddaysoftware.com//NONSGML DDay.iCal 1.0//EN
VERSION:2.0
BEGIN:VEVENT
DTEND:20160829T090000
DTSTAMP:20160829T115057Z
DTSTART:20160829T080000
EXDATE:20160830T080000/PT1H
RDATE:20160830T100000/PT1H
RRULE:FREQ=DAILY
SEQUENCE:0
SUMMARY:Do your cardio
UID:abab717c-1786-4efc-87dd-6859c2b48eb6
END:VEVENT
END:VCALENDAR

A better example

An even better example would wrap the ical text in a unit test that asserted the expected behavior, if you can, so I can incorporate it into the extensive ical.net unit test suite as part of the fix. I realize not everyone can do this, and that's OK.

public void RDateShouldBeUnionedWithRecurrenceSet()
{
    const string ical =
@"BEGIN:VCALENDAR
PRODID:-//ddaysoftware.com//NONSGML DDay.iCal 1.0//EN
VERSION:2.0
BEGIN:VEVENT
DTSTART:20160829T080000
DTEND:20160829T090000
EXDATE:20160830T080000/PT1H
RDATE:20160830T100000/PT1H
RRULE:FREQ=DAILY
SEQUENCE:0
SUMMARY:Do your cardio
UID:abab717c-1786-4efc-87dd-6859c2b48eb6
END:VEVENT
END:VCALENDAR";

    var collection = Calendar.LoadFromStream(new StringReader(ical));
    var firstEvent = collection.First().Events.First();
    var startSearch = new CalDateTime(DateTime.Parse("2015-08-28T07:00:00"), _tzid);
    var endSearch = new CalDateTime(DateTime.Parse("2016-08-28T07:00:00").AddDays(7), _tzid);

    var occurrences = firstEvent.GetOccurrences(startSearch, endSearch)
        .Select(o => o.Period as Period)
        .OrderBy(p => p.StartTime)
        .ToList();

    var expectedRDate = new CalDateTime(DateTime.Parse("2016-08-30T10:00:00"), _tzid);
    Assert.IsTrue(occurrences[1].StartTime.Equals(expectedRDate));
}