Skip to content
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

Elasticsearch: Queries no longer executed while typing #87652

Merged
merged 2 commits into from
May 16, 2024

Conversation

matyax
Copy link
Contributor

@matyax matyax commented May 10, 2024

With this change, the query is no longer immediately run while it's being typed. This was a simple way, without a bigger impact, to achieve this result.

Which issue(s) does this PR fix?:

Fixes #79463

Special notes for your reviewer:

Please check that:

  • It doesn't break anything.

Demo:

Demo.mov

@matyax matyax requested a review from a team as a code owner May 10, 2024 17:03
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.1.x milestone May 10, 2024
@matyax
Copy link
Contributor Author

matyax commented May 10, 2024

Even if this implementation doesn't fully work, the fix is around this code and doesn't look too complex.

Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

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

🚀

@matyax matyax force-pushed the matyax/elastic-dont-run-query branch from 0ea1176 to 1bc5b81 Compare May 16, 2024 09:18
onChange(query);
onRunQuery();
if (query.query === prevQuery.query || prevQuery.query === undefined) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anecdotically, running the query when it was previously undefined was required to make a test case pass, which was the correct implementation. This highlights again how important is to have quality unit tests, not only to prevent regressions, but to allow for refactors that don't break functionality.

@matyax matyax added the no-backport Skip backport of PR label May 16, 2024
@matyax matyax enabled auto-merge (squash) May 16, 2024 10:03
@matyax matyax changed the title Elasticsearch: queries no longer executed on-change Elasticsearch: Queries no longer executed while typing May 16, 2024
@matyax matyax added no-changelog Skip including change in changelog/release notes add to changelog and removed add to changelog no-changelog Skip including change in changelog/release notes labels May 16, 2024
@matyax matyax force-pushed the matyax/elastic-dont-run-query branch from 7f1b2be to 11bb5e4 Compare May 16, 2024 15:55
@matyax matyax merged commit 82796fa into main May 16, 2024
14 checks passed
@matyax matyax deleted the matyax/elastic-dont-run-query branch May 16, 2024 16:09
@kevinwcyu kevinwcyu modified the milestones: 11.1.x, 11.1.0 Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Easticsearch: remove running queries on-change
3 participants