Skip to content

Fix non-deterministic fleet names in recent activity#25601

Merged
kroepke merged 6 commits intomasterfrom
fix_25384
Apr 15, 2026
Merged

Fix non-deterministic fleet names in recent activity#25601
kroepke merged 6 commits intomasterfrom
fix_25384

Conversation

@kroepke
Copy link
Copy Markdown
Member

@kroepke kroepke commented Apr 10, 2026

Summary

Fixes #25384
/nocl unreleased feature

  • Activity entries targeting multiple fleets (e.g. INGEST_CONFIG_CHANGED which targets all fleets) displayed only targets[0], whose position depends on Java Set iteration order — non-deterministic across JVM instances/restarts
  • Sort targets alphabetically on the frontend using toSorted() so the displayed fleet name is always deterministic
  • Show "and N other fleet(s)" text for multi-target entries, which were previously silently showing a single arbitrary fleet
  • Narrow useRecentActivity return type to match the useCollectorsConfig pattern

Test plan

  • Verify fleet names in recent activity are stable when toggling between Overview and Fleets pages
  • Verify INGEST_CONFIG_CHANGED entries show "and N other fleets" when multiple fleets exist
  • Verify single-fleet entries display without additional text
  • npx jest --no-coverage src/components/collectors/overview/RecentActivity.test.tsx passes (5 tests)

When activity entries target multiple fleets (e.g. INGEST_CONFIG_CHANGED),
the backend returns targets in Set iteration order which varies across JVM
instances. The frontend displayed only targets[0], causing fleet names to
appear to swap when requests hit different nodes or after restarts.

Sort targets alphabetically on the frontend and show "and N other fleet(s)"
for multi-target entries. Narrow useRecentActivity return type to match the
useCollectorsConfig pattern for type-safe test mocks.
@kroepke kroepke requested a review from a team April 10, 2026 10:54
@thll
Copy link
Copy Markdown
Contributor

thll commented Apr 13, 2026

@kroepke the frontend doesn't compile anymore. I'm afraid it's due to #25580 being merged. Do you want to take care of that or should I have a go at it?

@kroepke
Copy link
Copy Markdown
Member Author

kroepke commented Apr 14, 2026

@kroepke the frontend doesn't compile anymore. I'm afraid it's due to #25580 being merged. Do you want to take care of that or should I have a go at it?

i'll take look, np

@thll thll self-assigned this Apr 15, 2026
Copy link
Copy Markdown
Contributor

@thll thll left a comment

Choose a reason for hiding this comment

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

I couldn't replicate the bug again, but the fix is sound and I'm confident that it fixes the issue. The way we display the affected targets is much nicer now.

@kroepke kroepke merged commit 71f05bf into master Apr 15, 2026
24 checks passed
@kroepke kroepke deleted the fix_25384 branch April 15, 2026 14:35
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.

Collectors recent activity sometimes doesn't resolve fleet names

3 participants