protocol(engine): Transport does not get updated when upgrade from WebSocket to WebTransport.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
Describe the bug
Transport does not get updated when upgrade from WebSocket to WebTransport (when manually disable polling).
To Reproduce
Please fill the following code example:
Engine.IO server version: 6.6.4
Server
(Omitted, a correctly configured socket server with WebTransport enabled, see https://github.com/socketio/socket.io/blob/main/examples/webtransport/index.js)
Engine.IO client version: 6.6.3
Client
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Socket.IO WebTransport example</title>
</head>
<body>
<script src="engine.io.js"></script>
<script>
const socket = new eio({
transports: ['websocket', 'webtransport'],
transportOptions: {
websocket: { port: 1500 },
webtransport: { port: 1650 },
},
});
</script>
</body>
</html>
Expected behavior
Subsequent request should sent by WebTransport.
Actual behavior
engine.transport is still a WebSocket, marked upgrading = true, make it never success to sendmessage for both transports.
Additional context
In following code snippet, the callback in pause() would not be called if the original transport is WebSocket.
Contributor guide
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.
Research direction
Read packages/engine.io-client/lib/socket.ts around lines 1029-1042, starting with pause() and how the WebSocket-to-WebTransport upgrade is handled. Reproduce the configuration with transports set to websocket and webtransport, then verify that the transport is updated and subsequent requests use WebTransport without leaving the socket marked as upgrading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100