-
Notifications
You must be signed in to change notification settings - Fork 891
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
[data] reset query when disabling query enhancements if type is not supported #8772
base: main
Are you sure you want to change the base?
[data] reset query when disabling query enhancements if type is not supported #8772
Conversation
… type For example if the user selects SQL, then disables query enhancements we will default it back to DQL. This is to avoid bad state or failures. Issue: n/a Signed-off-by: Kawika Avilla <[email protected]>
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
@@ -57,6 +57,28 @@ export class QueryStringManager { | |||
this.queryHistory = createHistory({ storage: this.sessionStorage }); | |||
this.datasetService = new DatasetService(uiSettings, this.sessionStorage); | |||
this.languageService = new LanguageService(this.defaultSearchInterceptor, this.storage); | |||
|
|||
this.uiSettings.get$(UI_SETTINGS.QUERY_ENHANCEMENTS_ENABLED).subscribe((isEnabled) => { |
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 isn't safe enough. It should be something on page load ideally that checks for the flag and does any cleanup actions. Since we require a page reload for the flag, that should take care of the change listener missing the change and letting the bad state persist
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.
Is it possible that the setting changes before subscription set up or already in a bad state (ex. SQL) when the subscription is established?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8772 +/- ##
==========================================
- Coverage 60.75% 60.75% -0.01%
==========================================
Files 3798 3798
Lines 90688 90696 +8
Branches 14275 14278 +3
==========================================
+ Hits 55100 55101 +1
- Misses 32089 32096 +7
Partials 3499 3499
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@kavilla is this for 2.18 or 2.19? |
Description
Reset the query to DQL and an empty string and update to use a default index pattern when query enhancements went from enabled to disabled.
For example if the user selects SQL, then disables query enhancements we will default it back to DQL. This is to avoid bad state or failures.
Another example would be having an S3 data type which is not supported by default.
Issues Resolved
n/a
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration