Skip to content

bug(lsp): fence document cleanup to the owning server instance #921

Closed

Description

@Juliusolsson05

Expected behavior

Cleanup always disposes the old instance's owned resources while deleting shared records only when owned by that exact server generation.

Source finding and impact

discardServer guards deletion of the server registry with object identity, but deletes docs and serverDocuments by reusable server.key. A late old-server callback can remove replacement-server documents sharing that key.

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

Install replacement server documents under the same key, then deliver old exit/initialization failure. Replacement documents and diagnostics remain; old resources are released exactly once.

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

Refs #918; planning finding F08.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions