[Security Solution] Adds callback onUpdatePageIndex to get current pageIndex in Unified Data table#201240
Conversation
PhilippeOberti
left a comment
There was a problem hiding this comment.
hey @logeekal at first glance everything worked perfectly, but doing a little more testing I noticed that as soon as we navigate to the last page and click on Load more, then everything is completely messed up:
- the events per page returned by the new callback don't match the events rendered in the UI
- the callback isn't being triggered at all for all the newly loaded pages
Here's a video with audio explanation on what I'm seeing locally
Screen.Recording.2024-11-21.at.4.20.31.PM.mov
I knew you will find something 👨🎤 .. it looks like this is something which already exists. Raised a bug for that here : #201330 Will try to see if we can fix it in this PR itself. I think it is a small fix. EditFixed here : 1722d31 EditFound another bug : #201405 But let's take this one separately. |
|
/ci |
|
/ci |
|
/ci |
| beforeEach(() => { | ||
| (UnifiedTimeline as unknown as jest.Mock).mockImplementation(MockUnifiedTimelineComponent); | ||
| }); | ||
| it('should pass correct page rows', () => { |
There was a problem hiding this comment.
Responsibility of collating events has been moved useTimelineEvents so this test is not needed here.
pageIndex in Unified Data table
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
There was a problem hiding this comment.
Found another issue, this time in the Correlation tab:
- the first time we enter a query to fetch data, notes aren't being fetched
- then when navigating between pages we do fetch notes, but the ids don't seem to match what's rendered in the view
Screen.Recording.2024-11-22.at.10.45.46.AM.mov
And checked on main and on the Correlation tab at least we are fetching all the notes for all the events. With this branch in its current state now, we are not fetching anything on first refresh, and we're fetching the wrong information when changing page...
Screen.Recording.2024-11-22.at.10.58.42.AM.mov
Let's discuss this more next week!
davismcphee
left a comment
There was a problem hiding this comment.
Code-only review, Unified Data Table onChangePage change LGTM 👍
@davismcphee , I have re-requested your review as I found a bug in To demonstrate the scenario in which this situation happens, see below video. I have tried to do the sanity check of discover as well and it seems to be working fine as before. Will request you to desk-test as well. pageIndex.bug.mp4You can checkout the exact change here : d7f35ab |
|
/ci |
davismcphee
left a comment
There was a problem hiding this comment.
Thanks for the updates @logeekal! It seems like there may still be a bug related to the handling of pageIndex, though.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
|
pageIndex in Unified Data tableonUpdatePageIndex to get current pageIndex in Unified Data table
davismcphee
left a comment
There was a problem hiding this comment.
Thanks for working through this with me, the latest Unified Data Table changes LGTM 👍 I'm happy we landed on a solution that's relatively straight forward and minimizes the use of effects 🙂
|
Starting backport for target branches: 8.16, 8.17, 8.x https://github.com/elastic/kibana/actions/runs/12087104191 |
💔 All backports failed
Manual backportTo create the backport manually run: 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:  ## 👨💻 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/tabs/eql/index.tsx # x-pack/plugins/security_solution/public/timelines/containers/index.test.tsx
…`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:  ## 👨💻 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/tabs/eql/index.tsx # x-pack/plugins/security_solution/public/timelines/containers/index.test.tsx
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. 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:  ## 👨💻 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
…rrent `pageIndex` in Unified Data table (#201240) (#202345) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)](#201240) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2024-11-29T15:14:27Z","message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","v9.0.0","Team:Threat Hunting:Investigations","v8.16.2"],"number":201240,"url":"https://github.com/elastic/kibana/pull/201240","mergeCommit":{"message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201240","number":201240,"mergeCommit":{"message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623"}},{"branch":"8.16","label":"v8.16.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…urrent `pageIndex` in Unified Data table (#201240) (#202349) # Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)](#201240) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2024-11-29T15:14:27Z","message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","v9.0.0","Team:Threat Hunting:Investigations","v8.16.2"],"number":201240,"url":"https://github.com/elastic/kibana/pull/201240","mergeCommit":{"message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201240","number":201240,"mergeCommit":{"message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623"}},{"branch":"8.16","label":"v8.16.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…urrent `pageIndex` in Unified Data table (#201240) (#202348) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)](#201240) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2024-11-29T15:14:27Z","message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","v9.0.0","Team:Threat Hunting:Investigations","v8.16.2"],"number":201240,"url":"https://github.com/elastic/kibana/pull/201240","mergeCommit":{"message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201240","number":201240,"mergeCommit":{"message":"[Security Solution] Adds callback `onUpdatePageIndex` to get current `pageIndex` in Unified Data table (#201240)\n\n## Summary\n\nHandles resolution for\n- Notes fetching data for all Timeline Records which leads to\nperformance issues.\n- #201330 \n\n## Issue - Notes fetching data for all Timeline Records \n\nCurrently, there was no way for consumer of `UnifiedDataGrid` to get the\ncurrent `pageIndex`. Security Solution needs to get the current\n`pageIndex` so the items on the current page can be calculated.\n\n@elastic/kibana-data-discovery , please let us know if you have any\nopinion here.\n\nThis results in notes being fetched for all Timeline Records which means\nminimum of 500 records and if user has queries 5000 records ( for\nexample ), a request will be made to query notes for all those 5000\nnotes which leads to performance issue and sometimes error as shown\nbelow:\n\n\n\n\n\n## 👨💻 Changes\n\nThis adds attribute `pageIndex` to timeline state. \n\n```javascript\n{\n \"pageIndex\": number\n}\n```\n`pageIndex` helps with getting the events for that particular page.\n\n## 🟡 Caveat\n\n- Currently this `pageIndex` is shared between Query and EQL tabs which\ncan lead to wonky behavior at time.\n- Additionally, as of now table maintains its own page index and\nconsumer component cannot effect the `pageIndex` of the UnifiedDataGrid.","sha":"de9d5465df5900936991d79306cb2cbbe63f4623"}},{"branch":"8.16","label":"v8.16.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…`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:  ## 👨💻 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.
…`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:  ## 👨💻 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: # src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.test.tsx # src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx # x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.test.tsx # x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx # x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.tsx # x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx # x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx # x-pack/solutions/security/plugins/security_solution/public/timelines/containers/index.test.tsx
Summary
Handles resolution for
Issue - Notes fetching data for all Timeline Records
Currently, there was no way for consumer of
UnifiedDataGridto get the currentpageIndex. Security Solution needs to get the currentpageIndexso 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:
👨💻 Changes
This adds attribute
pageIndexto timeline state.pageIndexhelps with getting the events for that particular page.🟡 Caveat
pageIndexis shared between Query and EQL tabs which can lead to wonky behavior at time.pageIndexof the UnifiedDataGrid.