Skip to content

Fix broken language service and double-execution in playground#3238

Open
minestarks wants to merge 1 commit into
mainfrom
minestarks/fix-playground-worker
Open

Fix broken language service and double-execution in playground#3238
minestarks wants to merge 1 commit into
mainfrom
minestarks/fix-playground-worker

Conversation

@minestarks
Copy link
Copy Markdown
Member

@minestarks minestarks commented May 19, 2026

The playground the language service was non-functional, and the compiler was silently double-executing every request.

What was happening:

With #3153 :

  • The BrowserWorkerHost blob bootstrap registered message handlers via self.addEventListener("message", handler)
  • Consumers (like the playground) also assign self.onmessage = messageHandler
  • Both fire on every message, so initService ran twice (crashing on the second initLogging call) and every subsequent request produced duplicate responses that confused the proxy

Fix:

  • Switch the blob's onMessage implementation to self.onmessage = handler — now when a consumer reassigns self.onmessage with the same handler, it's just a harmless overwrite instead of a second registration
  • No changes needed in downstream consumers

@minestarks minestarks changed the title Fix double message handling in browser worker bootstrap Fix broken language service and double-execution in playground May 19, 2026
@minestarks minestarks marked this pull request as ready for review May 19, 2026 22:47
@minestarks minestarks requested a review from joao-boechat May 20, 2026 00:53
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