Skip to content

Fix unsafe parsedDiagnostics array push #549

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

Closed
wants to merge 1 commit into from

Conversation

fhammerschmidt
Copy link
Member

fixes #548

Not sure what changed or why we did not encounter this before yet.

Maybe we want it to crash here, because there is some message shape that we did not take into account?

@cristianoc
Copy link
Collaborator

CC @zth

@zth
Copy link
Collaborator

zth commented Aug 9, 2022

Yes, exactly, we haven't done this type of fix because this in essence means we've missed cases in parsing, and we don't want to swallow that, better have people report it.

I'm thinking we could do this fix (since not crashing is good) if we combine it with prompting the user that something went wrong and logging instructions for how to report the issue with relevant information. Kind of like we did in #544.

What do you think @cristianoc @fhammerschmidt ?

@cristianoc
Copy link
Collaborator

We are already giving better reports sincea recent PR. I would say let's see how that goes first.

@zth
Copy link
Collaborator

zth commented Aug 9, 2022

You mean for the reanalyze error message?

@cristianoc
Copy link
Collaborator

You mean for the reanalyze error message?

Forgot what the PR was for.
But in general I think we first want an actionable report, and let it crash. Then see if that experience is adequate or something should be added later.
Just would not want to make it too easy to ignore existing issues.

@cristianoc
Copy link
Collaborator

We are particularly vulnerable with platforms not widely used, and it would be nice to make sure that corner case issues get reported.

@zth
Copy link
Collaborator

zth commented Aug 9, 2022

I think we can make the prompt "annoying" if we want, but letting it crash will mean making the extension unusable for users as long as that diagnostic is reported. I think it would be nice to avoid that, but sure, we could let it happen to make it very sure that people report the issue.

@cristianoc
Copy link
Collaborator

cristianoc commented Aug 9, 2022

I think we can make the prompt "annoying" if we want, but letting it crash will mean making the extension unusable for users as long as that diagnostic is reported. I think it would be nice to avoid that, but sure, we could let it happen to make it very sure that people report the issue.

I was thinking of making it annoying or things might not be reported. As a first step. Then learn from there.

@cristianoc
Copy link
Collaborator

cristianoc commented Aug 9, 2022

Also, if a more robust fix is desired, then it's better to move towards a more robust fix. Rather than sweep the issue under the carpet.

The more robust fix is not to print random text on one side, coupled with random text parsing on the other side, and hope for the best. But to export in a specified JSON format, and read that.

@fhammerschmidt
Copy link
Member Author

So what do you suggest should I do with this PR? Obviously, the more robust fix is a bit out of scope.

@cristianoc
Copy link
Collaborator

I suggest to drop it. It's not very different to adding -1 to the return of a wrong program that returns the results off by 1.

@fhammerschmidt fhammerschmidt deleted the fix-548 branch August 10, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server crash with TypeError: Cannot read properties of undefined (reading 'content')
3 participants