Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.16] [Security Solution] Adds callback onUpdatePageIndex to get current pageIndex in Unified Data table (#201240) #202349

Open
wants to merge 1 commit into
base: 8.16
Choose a base branch
from

Conversation

logeekal
Copy link
Contributor

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

…`pageIndex` in Unified Data table (elastic#201240)

## Summary

Handles resolution for
- Notes fetching data for all Timeline Records which leads to
performance issues.
- elastic#201330

## Issue - Notes fetching data for all Timeline Records

Currently, there was no way for consumer of `UnifiedDataGrid` to get the
current `pageIndex`. Security Solution needs to get the current
`pageIndex` so the items on the current page can be calculated.

@elastic/kibana-data-discovery , please let us know if you have any
opinion here.

This results in notes being fetched for all Timeline Records which means
minimum of 500 records and if user has queries 5000 records ( for
example ), a request will be made to query notes for all those 5000
notes which leads to performance issue and sometimes error as shown
below:

![image](https://github.com/user-attachments/assets/6fcfe05d-340c-4dcb-a273-5af53ed12945)

## 👨‍💻 Changes

This adds attribute `pageIndex` to timeline state.

```javascript
{
    "pageIndex": number
}
```
`pageIndex` helps with getting the events for that particular page.

## 🟡 Caveat

- Currently this `pageIndex` is shared between Query and EQL tabs which
can lead to wonky behavior at time.
- Additionally, as of now table maintains its own page index and
consumer component cannot effect the `pageIndex` of the UnifiedDataGrid.

(cherry picked from commit de9d546)

# Conflicts:
#	x-pack/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.tsx
#	x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx
#	x-pack/plugins/security_solution/public/timelines/containers/index.test.tsx
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 29, 2024

💔 Build Failed

Failed CI Steps

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants