-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[UnifiedSearch][ESQL] Fix edited query overwriting when a request is finished #224671
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
Merged
kertal
merged 14 commits into
elastic:main
from
kertal:unified-search-prevent-esql-edit-overwrite
Jul 3, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9ca5648
Fix query handling in SearchBarUI for aggregate query type changes
kertal 07c7ff0
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal 862d48e
Deangularize the comments
kertal cf62de5
Make use of the onQueryChange when creating the search bar
kertal 07ceacc
Merge remote-tracking branch 'upstream/main' into unified-search-prev…
kertal fecbe86
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal 2fef9e5
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal eebc719
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal d1c0e34
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal 0bba1f7
Merge remote-tracking branch 'upstream/main' into unified-search-prev…
kertal edec388
Reverting `props.onQueryChange`
kertal 32cc820
Add a unit test to cover the fix
kertal 4334ab2
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal d631ab1
Merge branch 'main' into unified-search-prevent-esql-edit-overwrite
kertal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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 is the main change, we mimic what KQL does. before this change, for ESQL the query was overwritten every time, since it was not checked if the new props value differs from the old one. Now this works.
I tried to cover this change with a unit test, but I couldn't make it work. Since on re-render the currentProps.query.esql, was not kept. This made the unit test pointless 🤷
I mean, we could refactor this part to a unit test, to a pure function. Open to apply this change if valued reviewers want to have it. Or have other ideas
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.
I'm not overly worried about it tbh, but I wonder if it's possible to test the rendered output in an RTL test? I might not understand exactly what was making it hard to test though. Otherwise a separate function like you mentioned would work if you're feeling proactive.
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.
Yes, I wanted to do this, I've tried and it didn't work, it might be me of course
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.
I've found a way to cover this in a simple way
32cc820
first test fails when I remove the fix