You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Lifecycle] Formatter placeholder can be re-registered after disposal #138
With isFormatter: true, an in-flight runServer() can re-register the formatter placeholder after its context has been disposed if the restart rejects. The catch path registers the placeholder without checking whether the context was disposed; NullFormatter.dispose() only unregisters the current provider.
Reproduction
Start ctx.runServer() with restartServer held pending and wait until it has been entered.
Call ctx.dispose() and verify the existing placeholder is disposed.
Reject the held restart and await runServer().
Observe a second placeholder registration, with its disposable still live after the context was disposed.
Confirmed using the real context and NullFormatter with a deferred restart rejection on Node 24.17.0. A real rejection can occur, for example, if getDebuggerPath() rejects before restartServer enters its creation/start handlers. This can leave a formatter provider registered after deactivation.
Follow-up
Prevent registrations after context disposal without changing the existing contract to wait for all in-flight starts. Discovered while reviewing #137; that issue is intentionally tests-only.
Activity
test: characterize TypeScript client lifecycle boundaries (S3) (#140)
fix: prevent formatter registration after context disposal (microsoft…