Skip to content

Commit 4e3c837

Browse files
Merge pull request #356 from EventStore/kunal/incorrect-message-count-ps-dashboard
Incorrect number of behind messages in persistent subscriptions dashboard [DB-116]
2 parents 265f3f9 + c51b3db commit 4e3c837

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/js/modules/competing/services/SubscriptionsMapper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ define(['./_module'], function (app) {
108108
current.behindByTime = undefined;
109109
current.behindStatus = '';
110110
} else {
111-
current.behindByMessages = (current.lastKnownEventPosition - current.lastCheckpointedEventPosition) + 1;
111+
if (current.lastKnownEventPosition == null) {
112+
current.behindByMessages = 0;
113+
} else {
114+
current.behindByMessages = (current.lastKnownEventPosition - current.lastCheckpointedEventPosition) + 1;
115+
}
112116
current.behindByTime = Math.round((current.behindByMessages / current.averageItemsPerSecond) * 100)/100;
113117
current.behindByTime = isFinite(current.behindByTime) ? current.behindByTime : 0;
114118
current.behindStatus = current.behindByMessages + ' / ' + current.behindByTime;

0 commit comments

Comments
 (0)