Skip to content

bug(lsp): validate completions against their post-synchronization revision #923

Closed

Description

@Juliusolsson05

Expected behavior

Capture an immutable request ticket after document synchronization, retaining separate client revision and server version, and validate result/resolve handles against that ticket.

Source finding and impact

getCompletions captures requestedDoc.version before sendDocRequest. The latter can restore another alias's draft through changeSharedDocument, advancing the version before dispatch. The final comparison can reject the result of its own synchronization.

Evidence and environment

Inspected source at 552914f5610518458f944fa1bdaf63f243685bd1 on 2026-09-12 in the local macOS workspace. This finding has not yet been reproduced through a running application or the package integration suite.

Regression and acceptance

Two client aliases share one server URI with different drafts. Switch the requesting alias through real sendDocRequest; valid completions survive internal sync while results made stale by a later user edit remain rejected.

The resolving PR must protect the observable contract and document any remaining uncertainty. This planning pass makes no runtime changes.

Refs #918; planning finding F10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sev:P2Real bug with a workaroundtype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions