Skip to content

[8.16] [Security Solution] Fix timeline dynamic batching (#204034) | [ Security Solution ] Fix Refetch logic with new timeline batching (#205893)#205674

Merged
logeekal merged 7 commits intoelastic:8.16from
logeekal:backport/8.16/pr-204034
Feb 6, 2025
Merged

Conversation

@logeekal
Copy link
Copy Markdown
Contributor

@logeekal logeekal commented Jan 7, 2025

## Summary

Handles :

### Issue with Batches
- elastic#201405
- Timeline had a bug where if users fetched multiple batches and then if
user adds a new column, the value of this new columns will only be
fetched for the latest batch and not old batches.
- This PR fixes that ✅ by cumulatively fetching the data for old batches
till current batch `iff a new column has been added`.
- For example, if user has already fetched the 3rd batch, data for
1st,2nd and 3rd will be fetched together when a column has been added,
otherwise, data will be fetched incrementally.

### Issue with Elastic search limit

- Elastic search has a limit of 10K hits at max but we throw error at
10K which should be allowed.
    - Error should be thrown at anything `>10K`. 10001 for example.
    - ✅  This PR fixes that just for timeline by allowing 10K hits.

### Removal of obsolete code

Below files related to old Timeline code are removed as well:
-
x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx
-
x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx

---------

Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
(cherry picked from commit 088169f)

# Conflicts:
#	packages/kbn-babel-preset/styled_components_files.js
#	x-pack/plugins/security_solution/public/common/mock/mock_timeline_search_service.ts
#	x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx
#	x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx
#	x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx
#	x-pack/solutions/security/plugins/security_solution/public/timelines/containers/index.test.tsx
@logeekal logeekal added the backport This PR is a backport of another PR label Jan 7, 2025
@logeekal logeekal enabled auto-merge (squash) January 7, 2025 06:49
@PhilippeOberti
Copy link
Copy Markdown
Contributor

@logeekal pinging just to make sure we're not loosing track of this

…lastic#205893)

## Summary

PR : elastic#204034 fixed some issues
with timeline batching. It was not able to fix one of the issue with
`Refetch` logic which exists in `main` ( resulting in a flaky test ) and
causing some tests to fail in `8.16`, `8.17` and `8.x`.

## Issue Description

There are 2 issues with below video:

1. When user updates a status of an alert, the `Refetch` only happens on
the first `batch`. This behaviour is flaky currently. Even if the user
is on nth batch, table will fetch 0th batch and reset the user's page
back to 1.



https://github.com/user-attachments/assets/eaf88a82-0e9b-4743-8b2d-60fd327a2443
     


3. When user clicks `Refresh` manually, then also only first (0th)
`batch` is fetched, which should have rather fetched all the present
batches.




https://github.com/user-attachments/assets/8d578ce3-4f24-4e70-bc3a-ed6ba99167a0



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.


- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 19.8MB 19.8MB +1.6KB

History

@logeekal logeekal changed the title [8.16] [Security Solution] Fix timeline dynamic batching (#204034) [8.16] [Security Solution] Fix timeline dynamic batching (#204034,#205893) Feb 6, 2025
@logeekal logeekal changed the title [8.16] [Security Solution] Fix timeline dynamic batching (#204034,#205893) [8.16] [Security Solution] Fix timeline dynamic batching (#204034) | [ Security Solution ] Fix Refetch logic with new timeline batching (#205893) Feb 6, 2025
@logeekal logeekal merged commit 476335a into elastic:8.16 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants