Commit 373beb6
# Backport
This will backport the following commits from `main` to `9.3`:
- [[Security Solution] fix missing dateRangeField logic in
useTimelineEventsHandler
(#256351)](#256351)
<!--- Backport version: 9.6.6 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Philippe
Oberti","email":"philippe.oberti@elastic.co"},"sourceCommit":{"committedDate":"2026-03-10T18:22:29Z","message":"[Security
Solution] fix missing dateRangeField logic in useTimelineEventsHandler
(#256351)\n\n## Summary\n\nWhile backporting this recently
merged\n[PR](#251827) to `8.19`,
the CI\nkept failing on the `should load more records according to
sample size\ncorrectly` unit test
in\n`x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx`.\n\nThe
issue was a missing piece of code in the
`useTimelineEventsHandler`.\nThis PR fixes that. I ran the tests locally
on the `8.19` branch with\nthis fix and they all passed.\n\nMore
explanation on the issue:\n_The test was failing because when we load
`loadNextBatch()` (which set\n`activeBatch` to `1`), the effect reruns,
compares search params, sees\nthem as different (because
`dateRangeField` existed only in\n`prevSearchParameters`), and resets
`newActiveBatch` to `0`._\n\n> [!NOTE]\n> This was not found on `main`
because the whole test file was\nskipped... This PR does not re-enable
the test file because further\nrefactor is needed to make the test pass.
Also the speed of the test\nneeds to be lowered (see
[this\nticket](https://github.com/elastic/kibana/issues/224186))","sha":"2c40e8ad7403c9c808806a8e0cbf969e5a3801fc","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting:Investigations","backport:all-open","v9.4.0"],"title":"[Security
Solution] fix missing dateRangeField logic in
useTimelineEventsHandler","number":256351,"url":"https://github.com/elastic/kibana/pull/256351","mergeCommit":{"message":"[Security
Solution] fix missing dateRangeField logic in useTimelineEventsHandler
(#256351)\n\n## Summary\n\nWhile backporting this recently
merged\n[PR](#251827) to `8.19`,
the CI\nkept failing on the `should load more records according to
sample size\ncorrectly` unit test
in\n`x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx`.\n\nThe
issue was a missing piece of code in the
`useTimelineEventsHandler`.\nThis PR fixes that. I ran the tests locally
on the `8.19` branch with\nthis fix and they all passed.\n\nMore
explanation on the issue:\n_The test was failing because when we load
`loadNextBatch()` (which set\n`activeBatch` to `1`), the effect reruns,
compares search params, sees\nthem as different (because
`dateRangeField` existed only in\n`prevSearchParameters`), and resets
`newActiveBatch` to `0`._\n\n> [!NOTE]\n> This was not found on `main`
because the whole test file was\nskipped... This PR does not re-enable
the test file because further\nrefactor is needed to make the test pass.
Also the speed of the test\nneeds to be lowered (see
[this\nticket](https://github.com/elastic/kibana/issues/224186))","sha":"2c40e8ad7403c9c808806a8e0cbf969e5a3801fc"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/256351","number":256351,"mergeCommit":{"message":"[Security
Solution] fix missing dateRangeField logic in useTimelineEventsHandler
(#256351)\n\n## Summary\n\nWhile backporting this recently
merged\n[PR](#251827) to `8.19`,
the CI\nkept failing on the `should load more records according to
sample size\ncorrectly` unit test
in\n`x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx`.\n\nThe
issue was a missing piece of code in the
`useTimelineEventsHandler`.\nThis PR fixes that. I ran the tests locally
on the `8.19` branch with\nthis fix and they all passed.\n\nMore
explanation on the issue:\n_The test was failing because when we load
`loadNextBatch()` (which set\n`activeBatch` to `1`), the effect reruns,
compares search params, sees\nthem as different (because
`dateRangeField` existed only in\n`prevSearchParameters`), and resets
`newActiveBatch` to `0`._\n\n> [!NOTE]\n> This was not found on `main`
because the whole test file was\nskipped... This PR does not re-enable
the test file because further\nrefactor is needed to make the test pass.
Also the speed of the test\nneeds to be lowered (see
[this\nticket](https://github.com/elastic/kibana/issues/224186))","sha":"2c40e8ad7403c9c808806a8e0cbf969e5a3801fc"}}]}]
BACKPORT-->
Co-authored-by: Philippe Oberti <philippe.oberti@elastic.co>
1 parent 98ce4b2 commit 373beb6
1 file changed
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
| |||
0 commit comments