-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hotfix] Clear saved query crashes kibana on Discover in some cases #63554
[Hotfix] Clear saved query crashes kibana on Discover in some cases #63554
Conversation
@@ -828,13 +828,9 @@ function discoverController( | |||
if (newSavedQueryId) { | |||
setAppState({ savedQuery: newSavedQueryId }); | |||
} else { | |||
//reset filters and query string, remove savedQuery from state | |||
// remove savedQueryId from state | |||
const state = { | |||
...appStateContainer.getState(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This what was causing a "loop". Since as a hot fix I just moved localStorage.get('kibana.userQueryLanguage')
into search_bar logic, this additional logic is not needed anymore.
query and filters are anyway synced outside of this
If I'd leave this code as is - the loop still will be fixed just by other changes. See the commit: 12c9c56
|
||
// fails: bug in discover https://github.com/elastic/kibana/issues/63561 | ||
// unskip this test when bug is fixed | ||
it.skip('changing language removes saved query', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed different bug, a bit related but with lower severity. created an issue: #63561
Pinging @elastic/kibana-app-arch (Team:AppArch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM from KibanaApp/Discover side, tested locally in Chrome 80, no more endless looping, thx!
I'm having some trouble producing the problem and I'm therefore uncertain if this fixes it. @Dosant perhaps we should pair, seems like it should be easy to reproduce. |
Was able to reproduce the problem and verify that this fixes the problem. Thanks @Dosant |
…astic#63554) * actual hotfix * clean up redundant code * add functional test
…astic#63554) * actual hotfix * clean up redundant code * add functional test
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: (56 commits) [i18n] Update CODEOWNERS (elastic#63354) add platform team definition of done (elastic#59993) [SIEM] move away from Joi for importing/exporting timeline (elastic#62125) Fix discover preserve url (elastic#63580) [alerting] Adds an alertServices mock and uses it in siem, monitoring and uptime (elastic#63489) Closes elastic#63109 for Service Map by resetting edges styles for the selected node (elastic#63655) MIgrated index_header to react (elastic#63490) Index pattern management UI -> TypeScript and New Platform Ready (indexed_fields_table) (elastic#63364) [SIEM] [Cases] Insert timeline and reporters/tags in table bug fixes (elastic#63642) [Reporting] Make usable default element positions (elastic#63191) [Reporting] Switch Serverside Config Wrapper to NP (elastic#62500) [Reporting] Add "warning" status as an alternate type of completed job (elastic#63498) Split action types into own page (elastic#63516) [Lens] Only show copy on save for previously saved docs (elastic#63535) Update README.md (elastic#63622) Bugfix clear saved query crashes kibana on Discover in some cases (elastic#63554) Add uptime CODEOWNER entries. (elastic#63616) [ML] Extract apiDoc params from the schema definitions (elastic#62933) Fix alerting documentation encryption key requirement (elastic#63512) Fix CODEOWNERS and sass lint paths (elastic#63552) ...
Summary
This hot fixes bug in Discover when clearing "Saved query". #63505
Bug is reproduced reliably in any environment if preferred query language in uiSettings is different from saved query language in localStorage. :
To reproduce:
The bug causing the loop is happening on integration level between discover and search_bar
src/plugins/data/public/ui/search_bar/lib/use_saved_query.ts
. When clearing saved_query search_bar tried to switch query to value from uiSettings, but discover then updated it to the value from localStorage. Then there is a loop condition caused by this and this has to be fixed separately in a generic way. I'll create a tech-debt ticket.I don't believe this is a proper fix. It is just the simplest and with the least amount of risk one.
This is the commit with the actual fix: 12c9c56
TODO:
connected_search_bar
to not cause infinite loops depending on inputs - this would be a proper fix. We need to increase test coverage focused on redundant renderings. Statefull <SearchBar/> hardening #63675Checklist
Delete any items that are not applicable to this PR.
For maintainers