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:
- Navigate to the log rate tab.
- Create a job.
- Navigate to the log rate results.
- Expand a row in the table.
- Change the time range in the date picker.
- 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):

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] |
|
); |
)
Kibana version:
masteras of 4be60e5Original 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:
Expected behavior:
The content shows the results for the selected date range.
Screenshots (if relevant):
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:kibana/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/top_categories_table.tsx
Lines 58 to 74 in 6cd888f