Skip to content

Conversation

@teja2
Copy link
Contributor

@teja2 teja2 commented Nov 24, 2025

No description provided.

@teja2 teja2 requested a review from a team as a code owner November 24, 2025 21:33
]);
const incomingEvent = new InstanceEvent(message.data);
if (this.seenEventKeys.has(incomingEvent.key)) {
return;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may be wrong here because then listOffset doesn't get updated properly.
@SteKoe @ulischulte your thoughts on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but as far as I can see, the offset is not used in the view anyway. I will dig into that and check if it is still needed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SteKoe any updates on this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listOffset is now respected and adjusted.

export function deduplicateInstanceEvents(events: InstanceEvent[]) {
const seen = new Set<string>();
return events.filter((event) => {
if (seen.has(event.key)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SteKoe is the event key really enough?
It's imperative, in my opinion, that a SBA instance X shows the events recorded by the same instance and not, for example, by the instance Y.
Otherwise there is no traceability anymore and it's, therefore, better to keep things as they're now by enduring the duplicates.

Copy link
Contributor

@SteKoe SteKoe Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the backend does not contain the instance name of SBA in the events, this would be a bigger change than just adding deduplication in frontend.

As key is just using instanceId and version, no. We have to respect any value here. Event type as well as timestamp. Otherwise the following events would be reduced, even though they are not the same:

const events = [
  {instance: '123', version: 1, type: "REGISTERED", timestamp: "678"},
  {instance: '123', version: 1, type: "DEREGISTERED", timestamp: "890"},
]

Thanks to the existing tests, I was able to extend the behavior and added some more use cases.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then you won't dedup anything I think

@SteKoe SteKoe changed the title Fix 4858 deduplicate fix(#4858): deduplicate events Feb 10, 2026
@SteKoe SteKoe enabled auto-merge (squash) February 10, 2026 10:45
@SteKoe SteKoe merged commit 257320b into codecentric:master Feb 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants