Missing Occurrences if DTSTART and BYHOUR/BYMINUTE do not match

We have an issue with occurrence generation that looks like a bug.


Test 1:
var pattern = new RecurrencePattern(“DTSTART:20140908T130000\r\nRRULE:FREQ=MONTHLY;BYMONTHDAY=2;BYHOUR=2”);
var dates = pattern.GenerateOccurrences(new DateTime(2015, 10, 1, 5, 0, 0), new DateTime(2015, 10, 2, 5, 0, 0));
Assert(dates.Count > 0); // Fails - no dates generated. We expected 10/2/2015 2AM to be generated…

If we change DTSTART to 20140908T020000 above, the code works. For most iCalendar formats, we were getting this behavior where if the DTSTART time portion was outside of the time interval of Pattern.GenerateOccurrences() even though the application of the BYHOUR rule should cause an occurrence to be generated. This seems like a bug to us.

However, we came across a scenario where this behavior works as we would expect:

Test 2:
var pattern = new RecurrencePattern(“DTSTART:20140908T130000\r\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=1”);
var dates = pattern.GenerateOccurrences(new DateTime(2015, 10, 4, 5, 0, 0), new DateTime(2015, 10, 5, 5, 0, 0));
Assert(dates.Count == 1); // Succeeds. 10/5/2015 1AM is returned

The time portion of DTSTART, when applied to potential generated date candidates, would put the occurrence outside of the generation window. However, it returns the correct occurrence.

If this is not a bug, what is causing this apparently inconsistent behavior? Am I misunderstanding something in the standard or your API?

Thanks,
-Tim

Hi Tim,

I have tested this code and observed the issue when DTSTART contains different hour value than BYHOUR in monthly recurrence. I have logged this issue under Id: EMAILNET-34995 for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.

The issues you have found earlier (filed as EMAILNET-34995) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thank you for giving us the updated build. It fixes the our reported bug. Unfortunately, we are now getting this unexpected behavior:


var pattern = new RecurrencePattern(“DTSTART:20140908T130000\r\nRRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=1”);
// Generate from Monday 3AM to Tuesday 3AM
var dates = pattern.GenerateOccurrences(new DateTime(2015, 10, 5, 3, 0, 0), new DateTime(2015, 10, 6, 3, 0, 0));
Assert(dates.Count == 0); // This now fails but works in your prior build. dates now contains the start dateTime of the generation sequence (10/5 3 AM) even though that dateTime does not match DTSTART or the recurrence pattern.

See similar behavior with these tests as well:
var pattern = new RecurrencePattern(“DTSTART:20151003T130000\r\nRRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;BYHOUR=1”);
// Generate from 1/1 3AM to 1/2 3AM
var dates = pattern.GenerateOccurrences(new DateTime(2016, 1, 1, 3, 0, 0), new DateTime(2016, 1, 2, 3, 0, 0));
Assert(dates.Count == 0); // This now fails but works in your prior build. dates now contains the start of generation

var pattern = new RecurrencePattern(“DTSTART:20151003T130000\r\nRRULE:FREQ=MONTHLY;BYDAY=MO;BYHOUR=1;BYSETPOS=2”);
// Generate from 10/12 3AM to 10/13 3AM
var dates = pattern.GenerateOccurrences(new DateTime(2015, 10, 12, 3, 0, 0), new DateTime(2015, 10, 13, 3, 0, 0));
Assert(dates.Count == 0); // This now fails but works in your prior build. dates now contains the start of generation

-Tim

Hi Tim,


We are sorry for the inconvenience you are facing. We are further investigating this issue at our end and shall soon share our feedback with you here.

Hi Tim,

We have investigated the issue further and have identified the problems you have mentioned. Our product team will fix the issue and we’ll update you here once there is some information available in this regard.

Hi Tim,

We have released a hotfix version for this issue. Please download the Aspose.Email for .NET 5.9.1 and share your feedback with us.

Forgot to reply. The hot fix (5.9.1) and the new release (6.0) both fix this issue. Thank you for the quick response.



Hi Tim,


Thank you for sharing your feedback. Please feel free to write to us if you have any further related to the API.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan