Skip to content

fix(dune): reconcile promotions by diagnostic - #2089

Open
rgrinberg wants to merge 1 commit into
masterfrom
push-urspztqutuvq
Open

fix(dune): reconcile promotions by diagnostic#2089
rgrinberg wants to merge 1 commit into
masterfrom
push-urspztqutuvq

Conversation

@rgrinberg

Copy link
Copy Markdown
Member

Dune attaches promotion metadata to individual diagnostics, but the server currently stores promotions only in a map keyed by source path. When two rules produce diagnostics that promote the same source, inserting the second promotion hits an assertion, aborts the whole diagnostic batch, and disconnects that Dune instance. #2087 records the resulting missing diagnostics, registration, and code action.

Introduce a promotion tracker that retains promotions by diagnostic identity while deriving the active source-path map used by code actions and cleanup. Each diagnostic batch is applied to the tracker first, then its previous and final active source sets are compared. A capability is registered when the first diagnostic for a source appears and unregistered only when the last one disappears, avoiding duplicate registrations and premature unregistration when diagnostics overlap.

With this reconciliation, both diagnostics are published without internal errors while the client receives one balanced promotion registration and one promotion code action.

@rgrinberg
rgrinberg force-pushed the push-urspztqutuvq branch 4 times, most recently from ea8c9a6 to c5071e8 Compare August 4, 2026 20:43
Use the tracker for Dune diagnostic batches and reconcile registrations from
the batch endpoints so diagnostics sharing a source keep one balanced dynamic
registration.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
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.

1 participant