IDDD_Samples icon indicating copy to clipboard operation
IDDD_Samples copied to clipboard

Erroneous log id when event store is empty

Open mwillema opened this issue 9 years ago • 3 comments

The method c.s.common.notification.NotificationLogFactory.calculateCurrentNotificationLogId computes an erroneous NotificationLogId when the event store is empty. For example NOTIFICATIONS_PER_LOGis set to 20. Then at line 61, 0 % 20 = 0. Then at line 64 remainderis set to 20. Finally, at line 67, lowis set to 0 - 20 + 1 = 19.

By changing the condition at line 63 into remainder == 0 && count > 0, the issue is fixed.

mwillema avatar May 11 '15 13:05 mwillema

If you would like to make this change and create a pull request, I will merge it. Let me know if you can do this, or if you want me to.

VaughnVernon avatar May 28 '15 22:05 VaughnVernon

I've done a pull request: https://github.com/VaughnVernon/IDDD_Samples/pull/19

mwillema avatar May 31 '15 18:05 mwillema

Thanks!

VaughnVernon avatar Jun 01 '15 22:06 VaughnVernon