Skip to content

[Logs UI] Content of expanded rows in log rate are not updated with new data #60300

@weltenwort

Description

@weltenwort

Kibana version: master as of 4be60e5

Original install method (e.g. download page, yum, from source, etc.): from source

Describe the bug:

The content of the expanded log rate rows doesn't update when new data are fetched.

Steps to reproduce:

  1. Navigate to the log rate tab.
  2. Create a job.
  3. Navigate to the log rate results.
  4. Expand a row in the table.
  5. Change the time range in the date picker.
  6. Observe that the row still shows the results from the previously selected date range.

Expected behavior:

The content shows the results for the selected date range.

Screenshots (if relevant):

grafik

Any additional context:

The content of the rows is stored as state, which is only updated when a row is expanded. Instead it should be stored as computed state using useMemo() similar to the table in the categories tab:

const expandedRowContentsById = useMemo(
() =>
[...expandedCategories].reduce<Record<number, React.ReactNode>>(
(aggregatedCategoryRows, categoryId) => ({
...aggregatedCategoryRows,
[categoryId]: (
<CategoryDetailsRow
categoryId={categoryId}
sourceId={sourceId}
timeRange={timeRange}
/>
),
}),
{}
),
[expandedCategories, sourceId, timeRange]
);
)

Metadata

Metadata

Assignees

Labels

Feature:Logs UILogs UI featureTeam:Infra Monitoring UI - DEPRECATEDDEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_servicesbugFixes for quality problems that affect the customer experiencev7.7.0

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions