Skip to content

Show partial results after search has been canceled#242346

Merged
lukasolson merged 24 commits into
elastic:mainfrom
lukasolson:show_results_after_cancel
Dec 16, 2025
Merged

Show partial results after search has been canceled#242346
lukasolson merged 24 commits into
elastic:mainfrom
lukasolson:show_results_after_cancel

Conversation

@lukasolson
Copy link
Copy Markdown
Contributor

@lukasolson lukasolson commented Nov 7, 2025

Summary

Resolves #205783.
Resolves #215950.

When a user clicks "Cancel" while a query is running, show the partial results instead of simply canceling the search request.

Before ("cancel" cancels the query and shows empty results):

Screen.Recording.2025-11-10.at.2.12.09.PM.mov

After ("cancel" retrieves the latest results, cancels the query, and shows the results):

Screen.Recording.2025-11-10.at.2.10.23.PM.mov

@lukasolson lukasolson self-assigned this Nov 7, 2025
@lukasolson lukasolson added Feature:Search Querying infrastructure in Kibana Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// labels Nov 7, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Project deployments require a Github label, please add one or more of ci:project-deploy-(elasticsearch|observability|security) and trigger the job through the checkbox again.

@lukasolson lukasolson added the Feature:ES|QL ES|QL related features in Kibana label Nov 11, 2025
@lukasolson lukasolson marked this pull request as ready for review November 22, 2025 00:34
@lukasolson lukasolson requested review from a team as code owners November 22, 2025 00:34
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@botelastic botelastic Bot added the Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) label Nov 22, 2025
@lukasolson lukasolson added backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes labels Nov 22, 2025
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abort controller reason change LGTM!

Copy link
Copy Markdown
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes make sense to me.

Working for me in a mixed ccs scenario:

Image

Also, I guess this is expected here since we don't have results?

Image

Let me know if there's anything else to test.

I'll leave the approval to Alex. Great feature!

Comment thread src/platform/test/functional/apps/discover/ccs_compatibility/_cancel_results.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to add a test to this suite for the cancelled case?

Copy link
Copy Markdown
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vis code change LGTM

Copy link
Copy Markdown
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested on ES|QL, things seem to work great. Test coverage has improved and I no longer see the undefined requests.

@lukasolson
Copy link
Copy Markdown
Contributor Author

Running the flaky test runner on this one: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/10073

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#10073

[❌] src/platform/test/functional/config.ccs.ts: 0/25 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#10090

[✅] src/platform/test/functional/config.ccs.ts: 25/25 tests passed.

see run history

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #121 / serverless observability UI - Cases and Rules Serverless Observability Cases Cases list row actions Severity to critical

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
expressions 1796 1802 +6
kibanaUtils 422 423 +1
total +7

Async chunks

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

id before after diff
dashboard 721.3KB 721.3KB +35.0B
discover 1.3MB 1.3MB +286.0B
total +321.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 442.4KB 442.8KB +406.0B
expressions 93.3KB 93.5KB +197.0B
kibanaUtils 48.8KB 49.0KB +134.0B
total +737.0B
Unknown metric groups

API count

id before after diff
expressions 2269 2275 +6
kibanaUtils 615 616 +1
total +7

History

cc @lukasolson

@lukasolson lukasolson merged commit d99c163 into elastic:main Dec 16, 2025
13 checks passed
@stratoula stratoula mentioned this pull request May 22, 2026
1 task
stratoula added a commit that referenced this pull request May 22, 2026
## Summary

This is a regression caused by
#242346. It changed the error:
from the original throwError(() => new AbortError()) to throwError(() =>
new AbortError((e.target as AbortSignal)?.reason)), intending to
preserve the abort reason in the error.

The editor though was not handling this kind of errors correctly causing
the following bug:

- I am in Lens ES|QL
- I cancel the query
- I see an error at the footer of my editor
- I click the error
- 💥 

This PR handles this kind of errors gracefully

<img width="722" height="493" alt="image"
src="https://github.com/user-attachments/assets/374eadfd-93e0-47d8-8e2f-a2e2c1e3caaf"
/>


### Checklist

- [ ] [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
jcger pushed a commit that referenced this pull request May 26, 2026
## Summary

This is a regression caused by
#242346. It changed the error:
from the original throwError(() => new AbortError()) to throwError(() =>
new AbortError((e.target as AbortSignal)?.reason)), intending to
preserve the abort reason in the error.

The editor though was not handling this kind of errors correctly causing
the following bug:

- I am in Lens ES|QL
- I cancel the query
- I see an error at the footer of my editor
- I click the error
- 💥 

This PR handles this kind of errors gracefully

<img width="722" height="493" alt="image"
src="https://github.com/user-attachments/assets/374eadfd-93e0-47d8-8e2f-a2e2c1e3caaf"
/>


### Checklist

- [ ] [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
stratoula added a commit that referenced this pull request May 26, 2026
# Backport

This will backport the following commits from `main` to `9.4`:
- [[ES|QL] Handles dom exceptions
(#270603)](#270603)

<!--- Backport version: 11.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT
[{"author":{"name":"Stratou","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2026-05-22T14:21:08Z","message":"[ES|QL]
Handles dom exceptions (#270603)\n\n## Summary\n\nThis is a regression
caused by\nhttps://github.com//pull/242346. It changed the
error:\nfrom the original throwError(() => new AbortError()) to
throwError(() =>\nnew AbortError((e.target as AbortSignal)?.reason)),
intending to\npreserve the abort reason in the error.\n\nThe editor
though was not handling this kind of errors correctly causing\nthe
following bug:\n\n- I am in Lens ES|QL\n- I cancel the query\n- I see an
error at the footer of my editor\n- I click the error\n- 💥 \n\nThis PR
handles this kind of errors gracefully\n\n<img width=\"722\"
height=\"493\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/374eadfd-93e0-47d8-8e2f-a2e2c1e3caaf\"\n/>\n\n\n###
Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"55690be1086a3f9316b0a0c150b41eca7de1af6e","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:ES|QL","Team:ESQL","backport:version","v9.5.0","v9.4.2"],"title":"[ES|QL]
Handles dom
exceptions","number":270603,"url":"https://github.com/elastic/kibana/pull/270603","mergeCommit":{"message":"[ES|QL]
Handles dom exceptions (#270603)\n\n## Summary\n\nThis is a regression
caused by\nhttps://github.com//pull/242346. It changed the
error:\nfrom the original throwError(() => new AbortError()) to
throwError(() =>\nnew AbortError((e.target as AbortSignal)?.reason)),
intending to\npreserve the abort reason in the error.\n\nThe editor
though was not handling this kind of errors correctly causing\nthe
following bug:\n\n- I am in Lens ES|QL\n- I cancel the query\n- I see an
error at the footer of my editor\n- I click the error\n- 💥 \n\nThis PR
handles this kind of errors gracefully\n\n<img width=\"722\"
height=\"493\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/374eadfd-93e0-47d8-8e2f-a2e2c1e3caaf\"\n/>\n\n\n###
Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"55690be1086a3f9316b0a0c150b41eca7de1af6e"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/270603","number":270603,"mergeCommit":{"message":"[ES|QL]
Handles dom exceptions (#270603)\n\n## Summary\n\nThis is a regression
caused by\nhttps://github.com//pull/242346. It changed the
error:\nfrom the original throwError(() => new AbortError()) to
throwError(() =>\nnew AbortError((e.target as AbortSignal)?.reason)),
intending to\npreserve the abort reason in the error.\n\nThe editor
though was not handling this kind of errors correctly causing\nthe
following bug:\n\n- I am in Lens ES|QL\n- I cancel the query\n- I see an
error at the footer of my editor\n- I click the error\n- 💥 \n\nThis PR
handles this kind of errors gracefully\n\n<img width=\"722\"
height=\"493\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/374eadfd-93e0-47d8-8e2f-a2e2c1e3caaf\"\n/>\n\n\n###
Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"55690be1086a3f9316b0a0c150b41eca7de1af6e"}},{"branch":"9.4","label":"v9.4.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Search Querying infrastructure in Kibana needs_docs release_note:feature Makes this part of the condensed release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.3.0

Projects

None yet