Skip to content

Fix duplicate diagnostics in LSP server#2977

Merged
miparnisari merged 1 commit intoauthzed:mainfrom
ivanauth:fix/issue-vscode-41-duplicate-diagnostics
Mar 20, 2026
Merged

Fix duplicate diagnostics in LSP server#2977
miparnisari merged 1 commit intoauthzed:mainfrom
ivanauth:fix/issue-vscode-41-duplicate-diagnostics

Conversation

@ivanauth
Copy link
Contributor

Fixes authzed/spicedb-vscode#41

The LSP server's ClientCapabilities struct mapped diagnostics at a non-standard JSON path, so pull diagnostics support was never detected. The server always pushed publishDiagnostics even when the client was already pulling via textDocument/diagnostic, causing duplicate errors.

Fixed by restructuring ClientCapabilities to match the LSP spec and detecting pull support via textDocument.diagnostic presence.

Tested manually — confirmed duplicates in VS Code before the fix and single errors after.

@ivanauth ivanauth requested a review from a team as a code owner March 20, 2026 17:00
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Mar 20, 2026
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.51%. Comparing base (8e2054a) to head (1a7d9bf).

❌ Your project check has failed because the head coverage (73.51%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2977      +/-   ##
==========================================
- Coverage   74.79%   73.51%   -1.27%     
==========================================
  Files         498      499       +1     
  Lines       61058    61060       +2     
==========================================
- Hits        45660    44881     -779     
- Misses      12198    12986     +788     
+ Partials     3200     3193       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

miparnisari
miparnisari previously approved these changes Mar 20, 2026
Copy link
Contributor

@miparnisari miparnisari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works great!

image

I will test this again with #2965

@miparnisari miparnisari force-pushed the fix/issue-vscode-41-duplicate-diagnostics branch from 016ff13 to 98b0565 Compare March 20, 2026 18:16
@ivanauth ivanauth force-pushed the fix/issue-vscode-41-duplicate-diagnostics branch from 98b0565 to 1916af4 Compare March 20, 2026 18:23
@miparnisari miparnisari enabled auto-merge (squash) March 20, 2026 18:25
…gnostics

Correct ClientCapabilities struct to match LSP spec, detecting
pull diagnostics support via textDocument.diagnostic presence.

Fixes authzed/spicedb-vscode#41
auto-merge was automatically disabled March 20, 2026 18:26

Head branch was pushed to by a user without write access

@ivanauth ivanauth force-pushed the fix/issue-vscode-41-duplicate-diagnostics branch from 1916af4 to 1a7d9bf Compare March 20, 2026 18:26
@miparnisari miparnisari enabled auto-merge (squash) March 20, 2026 18:27
@miparnisari miparnisari merged commit 075454c into authzed:main Mar 20, 2026
44 of 45 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duplicate error message

2 participants