Show partial results after search has been canceled#242346
Conversation
|
Project deployments require a Github label, please add one or more of |
…ana into show_results_after_cancel
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
ThomThomson
left a comment
There was a problem hiding this comment.
Abort controller reason change LGTM!
There was a problem hiding this comment.
Does it make sense to add a test to this suite for the cancelled case?
nickofthyme
left a comment
There was a problem hiding this comment.
Vis code change LGTM
drewdaemon
left a comment
There was a problem hiding this comment.
Retested on ES|QL, things seem to work great. Test coverage has improved and I no longer see the undefined requests.
Running the flaky test runner on this one: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/10073 |
Flaky Test Runner Stats🟠 Some tests failed. - kibana-flaky-test-suite-runner#10073[❌] src/platform/test/functional/config.ccs.ts: 0/25 tests passed. |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#10090[✅] src/platform/test/functional/config.ccs.ts: 25/25 tests passed. |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
cc @lukasolson |
## 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
## 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
# 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-->


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