Fix suggestions dropdown for query input#80990
Merged
sulemanof merged 7 commits intoelastic:masterfrom Oct 26, 2020
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
alexwizp
reviewed
Oct 20, 2020
Dosant
reviewed
Oct 20, 2020
| indexPatterns: [...objectPatterns, ...objectPatternsFromStrings], | ||
| }); | ||
| }; | ||
| if (!this.fetchIndexPatternsAbortController.signal.aborted) { |
Contributor
There was a problem hiding this comment.
I didn't test but, if I understood this correctly, this doesn't seem to be working as intended 🤔
Currently every time we are checking the LATEST abort controller, but we should instead check to the
abort controller which was created when we fired a corresponding fetch:
I think it should look something like this instead:
if (this.lastAbortController) this.lastAbortController.abort(); // make sure any older requests are canceled.
this.lastAbortController = new AbortController();
const currentAbortController = this.lastAbortController;
await fetch();
if (!currentAbortController.signal.aborted) {
//
this.setState()
this.updateSuggestions
}
0e8cd20 to
9ad9334
Compare
Contributor
Author
|
@elasticmachine merge upstream |
stratoula
approved these changes
Oct 22, 2020
Contributor
stratoula
left a comment
There was a problem hiding this comment.
Code is LGTM, I can't replicate the bug always, but I managed to replicate it on master. I can't replicate it with the new changes so it seems fine to me 🙂
alexwizp
approved these changes
Oct 22, 2020
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
sulemanof
added a commit
to sulemanof/kibana
that referenced
this pull request
Oct 26, 2020
* Fix suggestions * Increase timeout * Use abort controller * Update abort controller Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
sulemanof
added a commit
that referenced
this pull request
Oct 26, 2020
* Fix suggestions * Increase timeout * Use abort controller * Update abort controller Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Oct 26, 2020
…arm-phase-to-formlib * 'master' of github.com:elastic/kibana: [Trigger Actions UI] Properly unmount app (elastic#81436) skip flaky suite (elastic#81576) skip flaky suite (elastic#78373) [Security Solution] Fix styling of EditDataProvider content (elastic#81456) [Search] Error Alignment 2 (elastic#80965) [APM] Unskip test (elastic#81574) [ML] Fix partition value selection on the Single Metric Viewer (elastic#81585) cleaning up expression service types (elastic#80643) Fix suggestions dropdown for query input (elastic#80990) [Usage collection] Make `schema` mandatory (elastic#79999) [ILM] Update show/hide data tier logic on cloud (elastic#81455) added brace import to advanced settings (elastic#81458) chore(NA): add spec-to-console and plugin-helpers as devOnly dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #80831
Initial issue: When changing an index pattern in TSVB under panel options from the default one, the KQL autocompletion under "Panel filter" will still show the fields of the default index pattern until you switched away from the Panel Options tab and back to it (unmount - mount the filter component).
It seems the problem was in order of calling
updateSuggestionsmethod. Here are logs of asyncfetchIndexPatternscalls:Steps:
kibana_sample_data_logsindex pattern;kibana_sample_data_logand freezed untilfetchIndexPatternscompleted;kibana_sample_data_logs- then the resolvedfetchIndexPatternsimmediately updates the suggestions - and then the first call takes precedence and overrides the suggestions valueThe fix bring in the
AbortControllerto abort the previousfetchIndexPatterns.Also, the
debouncewas added to reduce the amount of calls.Checklist
Delete any items that are not applicable to this PR.
For maintainers