Skip to content

fix: handle LSP supported invalid configuration values#551

Merged
doorgan merged 1 commit intomainfrom
doorgan/invalid-configuration
Apr 7, 2026
Merged

fix: handle LSP supported invalid configuration values#551
doorgan merged 1 commit intomainfrom
doorgan/invalid-configuration

Conversation

@doorgan
Copy link
Copy Markdown
Collaborator

@doorgan doorgan commented Apr 3, 2026

Fix #540

Normalized invalid values to an empty map. The LSP spec apparently supports a variety of non-object values, so in this PR we just ignore anything that is not an object/map.

@katafrakt
Copy link
Copy Markdown
Contributor

Checking the code around, I discovered that we are not, in fact, ignoring such values. This causes reset to defaults - and same happens if settings is an empty map. I'm not sure this is a desired behaviour here.

Here's a branch with a failing tests reproducing the issue: https://github.com/katafrakt/expert/tree/invalid-config-test

@doorgan doorgan force-pushed the doorgan/invalid-configuration branch from d9e0dfe to db1038c Compare April 3, 2026 16:00
@doorgan
Copy link
Copy Markdown
Collaborator Author

doorgan commented Apr 3, 2026

Agh good catch, fixed!

@rmand97
Copy link
Copy Markdown
Contributor

rmand97 commented Apr 7, 2026

I have tested this locally with this branch and it fixes my issue, thanks

@doorgan doorgan merged commit e973cfc into main Apr 7, 2026
71 of 72 checks passed
@doorgan doorgan deleted the doorgan/invalid-configuration branch April 7, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Error when client sends null settings

3 participants