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

[Console] Parser can't parse valid requests after an invalid one #193552

Open
yuliacech opened this issue Sep 20, 2024 · 1 comment
Open

[Console] Parser can't parse valid requests after an invalid one #193552

yuliacech opened this issue Sep 20, 2024 · 1 comment
Labels
Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@yuliacech
Copy link
Contributor

The parser (source file) is currently used to detect the start and the end of requests in Console with further processing of the requests done in MonacoEditorActionsProvider (source file).

If a request is invalid, the parser stops working and can't detect any requests that might be valid after the invalid one. That happens because if the parser sees any character that is unexpected, an error is thrown (see this line).

A possible fix for this would be to have some logic in the parser, that would catch the error, register it to be displayed in the Console for the user and then restart the parsing process. I think we already have that logic in the function multi_request (see this code):

catch (e) {
          addError(e.message);
          // snap
          const substring = text.substr(at);
          const nextMatch = substring.search(/^POST|HEAD|GET|PUT|DELETE|PATCH/m);
          if (nextMatch < 1) return;
          reset(at + nextMatch);
        }
@yuliacech yuliacech added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Sep 20, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

2 participants