Playwright tunnel stop can hang while waiting for connection
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- tooling
Research direction
Locate PlaywrightTunnel.stopAsync() and _pollConnectionAsync(), then trace how the pending poll promise and _initWsPromise behave when stopping in waiting-for-connection mode. Reproduce a stop before any WebSocket connects and verify that stopAsync() settles, pending poll state is cleared, and the tunnel reaches stopped status.
Written by the indexing model from the issue text.
Description
Summary
PlaywrightTunnel.stopAsync() can hang when the tunnel is stopped while it is still waiting for a poll-connection client to arrive.
Why this is a separate issue
The current PR (#5851) fixes a Start/Stop lifecycle race by waiting for an in-progress stop before starting again. That does not address the case where Stop itself never settles while the tunnel is still in waiting-for-connection / poll-connection mode.
Suspected root cause
In poll-connection mode, _pollConnectionAsync() returns a promise that only resolves after a WebSocket connection succeeds. stopAsync() clears the polling interval, but it still awaits _initWsPromise, which can remain unresolved forever if Stop happens before a connection arrives.
Proposed fix shape
- Add a cancellation/settle path for the pending poll promise when stopping.
- Ensure
stopAsync()can complete even if no WebSocket ever connected. - Clear any pending poll state and set status to stopped as part of stop teardown.
Evidence
A local gws auth login flow now reaches a clean timeout when the VS Code extension never connects, which suggests the remaining stall is in the extension stop path rather than the remote side.
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 708
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 48
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/rushstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in microsoft/rushstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·