Summary
The Playwright Local Browser Server VS Code extension can get into a lifecycle race when Stop and Start are invoked in quick succession. The user-visible symptom is that Start/Stop sometimes needs to be run twice before the tunnel reaches the expected state.
Suspected cause
handleStopTunnelAsync() can make the active tunnel unavailable before the existing tunnel has fully finished stopAsync(). A following Start command can then proceed while the previous shutdown is still in progress.
Proposed fix
PR #5851 tracks an in-progress stop promise, waits for it before starting a replacement tunnel, and only clears the active tunnel reference after stopAsync() settles.
The PR also adds a focused real VS Code host regression test for the rapid Start/Stop/Start sequence.
Summary
The Playwright Local Browser Server VS Code extension can get into a lifecycle race when Stop and Start are invoked in quick succession. The user-visible symptom is that Start/Stop sometimes needs to be run twice before the tunnel reaches the expected state.
Suspected cause
handleStopTunnelAsync()can make the active tunnel unavailable before the existing tunnel has fully finishedstopAsync(). A following Start command can then proceed while the previous shutdown is still in progress.Proposed fix
PR #5851 tracks an in-progress stop promise, waits for it before starting a replacement tunnel, and only clears the active tunnel reference after
stopAsync()settles.The PR also adds a focused real VS Code host regression test for the rapid Start/Stop/Start sequence.