EventStore / EventStore.UI

The user interface for Event Store
57 stars 37 forks source link

Incorrect number of behind messages in persistent subscriptions dashboard [DB-116] #356

Closed dhingrak closed 1 year ago

dhingrak commented 1 year ago

Fixed: Incorrect number of behind messages in persistent subscrptions dashboard.

Fixes https://github.com/EventStore/EventStore.UI/issues/336

Currently # of messages in persistent subscription dashboard is showing 1 / 0 (behind messages) even the stream does not exists. The goal of this PR to fix the incorrect number of behind messages.

linear[bot] commented 1 year ago
DB-116 #of msgs in Persistent Subscription Dashboard in newer versions

The "#of msgs" column in the Persistent Subscription Dashboard in newer versions shows one extra/additional event (shows +1, should be -1). This behavior has been observed in newer versions (v21.10.7 and v21.10.8). However, such behavior is not observed in previous versions (not observed on v21.6). The below screenshot is from v21.10.8. The stream test-stream does not exist in the database and hence has no event. However as can be seen in the screenshot, the #of msgs column shows 1. [](https://uploads.linear.app/a2a29b63-594b-4491-8437-5f7f43da2367/9012ac4d-b68f-4375-a180-e03eac30dd75/c43798b7-5ca3-4af5-b15b-64447bc4bf2a) A similar observation has been made on v21.10.7. In the below screenshot, the stream test-stream4 does not have any event and does not exist in the database, but still the #of msgs column shows 1. [](https://uploads.linear.app/a2a29b63-594b-4491-8437-5f7f43da2367/ccfa58ca-3522-4985-9024-deed55cc6423/3268f6a3-f7c8-4ae4-b0f0-5cf661430fe4) However, in v21.6, this behavior is not observed. In the screenshot below, the stream test-stream4 does not have any event and does not exist in the database. As can be seen in the screenshot also, the #of msgs column also shows 0. [](https://uploads.linear.app/a2a29b63-594b-4491-8437-5f7f43da2367/30caa02d-5eea-4669-af0e-01e4087bd100/f6ae4f54-81e7-49ac-bf04-516c90ff2a55) Internal Ticket : [https://eventstore.freshdesk.com/a/tickets/110503](https://eventstore.freshdesk.com/a/tickets/110503) ### STEPS TO REPRODUCE THE ISSUE 1. Start server on v21.10.7 or v21.10.8. 2. Create a new Persistent Subscription on a stream that does not exist in the system. 3. It can be observed that the the #of msgs column shows 1 despite the stream having no events in it. 4. Repeat the above steps on v21.6 It can be observed that the the #of msgs column shows 0, which should be the ideal scenario.

hayley-jean commented 1 year ago

I can't reproduce the issue in 22.10.2. Was the off-by-one error still showing in the UI before this change?

The off-by-one error does show in the latest UI, but EventStore.ClusterNode.Web hasn't been updated in a while so the issue isn't present when building EventStore from master.

Once this PR is merged, we should update the UI in EventStore master as well