Skip to content

fix(graphql-language-service-server): run cache initialization once during startup - #4619

Open
lazerg wants to merge 1 commit into
graphql:mainfrom
lazerg:fix/issue-4613-single-cache-init
Open

lazerg wants to merge 1 commit into
graphql:mainfrom
lazerg:fix/issue-4613-single-cache-init

Conversation

@lazerg

@lazerg lazerg commented Oct 2, 2026

Copy link
Copy Markdown

Before the server is initialized, every file event goes through _loadConfigOrSkip, and nothing tracked an initialization that was already running. Events that arrived during a slow startup each started their own _initializeGraphQLCaches(). Each run swapped in a fresh GraphQLCache, so go-to-definition stayed unreliable until the last one finished.

This keeps the in-flight initialization promise and has later events await it instead of starting another run. It is cleared when the run settles, so a failed init can still be retried. Config reloads after startup and didChangeConfiguration work as before.

Fixes #4613

@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 74e3959

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
graphql-language-service-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: lazerg / name: lazerg (74e3959)

@trevor-scheer

Copy link
Copy Markdown
Contributor

Thanks for the PRs @lazerg, I have a busy couple weeks but I'll take a look when I'm able. In the meantime, please sign the CLA if you agree to it.

@lazerg

lazerg commented Oct 3, 2026

Copy link
Copy Markdown
Author

Signed

This branch has not been deployed

No deployments
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.

[lsp-server] 🐞 Cache initialization runs several times in parallel during startup

2 participants