ServiceScene: Retain loading state when query parser was incorrect #710
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.
Fixes: #705
Currently the change of the service variable triggers a query, the response changes the format variable, which triggers another logsPanel query with the correct parser. We don't want to set the initial fields state with the query with the invalid parser, so we set a flag when the parser changes to tell the service scene that the next response will be invalid.
A flag feels kinda icky, a better solution might be run the query explicitly like proposed in #709, which might give us more control over when these queries are run? That would allow us to prevent running the first query on change of the service, and instead we could run another query without any parser solely to determine what the parser should be for the subsequent logsPanelQuery.
Also detected_fields might make this unnecessary as well, as we would use that api call to get the count of the fields, instead of parsing the logsPanelQuery.