This project is read-only.

Old Notifications are Reposted to Users who've Received More than the Maximum Number of Notifications


Slicing by 0 in NotificationService.FetchNotifications() causes all notification batches to be returned, which results in old notifications being re-posted to users who've received more than 100 (the maximum) notifications.

The solution is to add the following early-return condition to FetchNotifications():
if (maxNotificationBatchCountToCheck <= 0)
    return Enumerable.Empty<INotification>();
PS. Not sure if this slice-by-zero quirk is an Orchard bug or not, but it seems to affect version 1.7.2.


Piedone wrote May 12, 2015 at 5:24 PM

Wow, so you say Slice(0) returns content items instead of returning an empty enumeration? This sounds like a huge Orchard bug.

Piedone wrote May 12, 2015 at 5:49 PM

I tested and on 1.8.1 this is not an issue. Interesting...