Skip to content

Fix streams overview metric columns not populating on initial load - #26824

Open
laura-b-g wants to merge 6 commits into
masterfrom
issue-26724/streams-metrics-loading
Open

Fix streams overview metric columns not populating on initial load#26824
laura-b-g wants to merge 6 commits into
masterfrom
issue-26724/streams-metrics-loading

Conversation

@laura-b-g

@laura-b-g laura-b-g commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description

Metric columns in the streams overview (message count, processing time, etc.) don't populate after being added to the view — cells stay empty until the page is reloaded.

Motivation and Context

`StreamsOverview` was calling `useUserLayoutPreferences('streams', '')` (empty string for the default view), while `PaginatedEntityTable` (via `useTableLayout`) calls `useUserLayoutPreferences('streams', undefined)`. Both map to the same backend URL, but they land in separate react-query cache entries because `''` and `undefined` are distinct query keys.

When the user adds a metric column, `useUpdateUserLayoutPreferences` only refetches the `undefined`-keyed entry. The `''`-keyed entry has a 1-hour `staleTime` and is never invalidated. So the table renders the new column (from the refreshed `undefined` entry), but `requestedFields` in `StreamsOverview` is computed from the stale `''` entry — the metric field is never requested, and the cells stay blank. Only a full page reload (clearing both cache entries) makes it work.

Fix: convert the empty-string default-view variant to `undefined` before passing it to `useUserLayoutPreferences`, so both callers share the same cache entry and both receive updated preferences after any column change.

How can this be tested?

  1. Open the Streams overview.
  2. Use the column picker to add a metric column (e.g. Message Count).
  3. Without reloading, verify that the column immediately shows data.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Closes #26724

…pdate without reload

The StreamsOverview component called useUserLayoutPreferences with an empty
string for the default view variant, while PaginatedEntityTable (via
useTableLayout) used undefined. Both map to the same URL but produce separate
react-query cache entries.

When the user added a metric column, useUpdateUserLayoutPreferences only
refetched the undefined-keyed entry (used by the table). The empty-string
entry in StreamsOverview had a 1-hour staleTime and was never invalidated,
so requestedFields stayed stale and the metrics query never fetched the new
field — cells remained empty until a full page reload.

Fix: convert the empty-string default-view variant to undefined before passing
it to useUserLayoutPreferences, so both callers share the same cache entry and
both get the updated preferences after a column change.

Closes #26724
@laura-b-g
laura-b-g requested a review from a team July 29, 2026 14:33
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.

Stream overview: Data in newly added columns sometimes only appears after reloading the page.

1 participant