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

Preference schema validation issue (rust vscode extension) #6106

Closed
AlexTugarev opened this issue Sep 4, 2019 · 4 comments · Fixed by #6110
Closed

Preference schema validation issue (rust vscode extension) #6106

AlexTugarev opened this issue Sep 4, 2019 · 4 comments · Fixed by #6110
Labels
bug bugs found in the application plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility

Comments

@AlexTugarev
Copy link
Contributor

when the rust extension for vscode is installed you'll see this error:

Uncaught Error: schema is invalid: data.properties['rust-client.channel'].type should be equal to one of the allowed values, data.properties['rust-client.channel'].type[1] should be equal to one of the allowed values, data.properties['rust-client.channel'].type should match some schema in anyOf

reason: it's reading ['rust-client.channel'].type = ["string", null] which should be ['rust-client.channel'].type = ["string", "null"].

because the resulting schema cannot be compiled, this breaks the update of the validateFunction leaving the old version of the validateFunction in place.

any call to the preference service requesting some affected preference key returns with empty result, i.e. preference not found.

@AlexTugarev AlexTugarev added bug bugs found in the application plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility labels Sep 4, 2019
@AlexTugarev
Copy link
Contributor Author

cf. rust-lang/vscode-rust#654

@akosyakov
Copy link
Member

@AlexTugarev please try with #6090

@AlexTugarev
Copy link
Contributor Author

@akosyakov the mentioned PR is proposing to not call schemaProvider.validate at all. this will effectively disable validation at at all, no? 😕

otoh, it won't actually solve the issue described ☝️ the validateFunction won't be updated once an invalid preference schema is added. I think the underlying issue is that adding the schema and validating are two independent steps.

@akosyakov
Copy link
Member

akosyakov commented Sep 5, 2019

otoh, it won't actually solve the issue described ☝️ the validateFunction won't be updated once an invalid preference schema is added. I think the underlying issue is that adding the schema and validating are two independent steps.

What's the use of a scheme if we don't do a validation anymore? I think doing warning check on a scheme is good to catch such issues, don't know why VS Code just swallow it and does not report back to VS Code extension developers. But rather than that we can move validation check to statically typed proxies in order to avoid breaking them and don't check anything in PreferenceService implementations to align with VS Code.

AlexTugarev added a commit that referenced this issue Sep 5, 2019
AlexTugarev added a commit that referenced this issue Sep 5, 2019
AlexTugarev added a commit that referenced this issue Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants