Problem
Socket.IO sets connected=true even when it falls back to HTTP long-polling through the Databricks Apps reverse proxy. The current code trusts this flag, which causes:
- Premature poll-worker termination — the app thinks it has a real WebSocket, stops the HTTP polling fallback, but actually doesn't have a WebSocket
- Degraded performance — users on long-polling don't get the poll-worker they need
Proposed Fix (cherry-pick from PR #52)
PR #52 includes a WebSocket detection fix that is independent of the OpenCode fork:
- Check
socket.io.engine.transport.name instead of trusting connected=true
- Listen for late transport upgrades (polling → websocket)
- Only terminate the poll-worker when a true WebSocket is confirmed
Why separate from PR #52
This is a change to static/index.html only. It doesn't require the OpenCode fork, spawner app, or any other PR #52 components.
Files affected
static/index.html — transport detection logic
Problem
Socket.IO sets
connected=trueeven when it falls back to HTTP long-polling through the Databricks Apps reverse proxy. The current code trusts this flag, which causes:Proposed Fix (cherry-pick from PR #52)
PR #52 includes a WebSocket detection fix that is independent of the OpenCode fork:
socket.io.engine.transport.nameinstead of trustingconnected=trueWhy separate from PR #52
This is a change to
static/index.htmlonly. It doesn't require the OpenCode fork, spawner app, or any other PR #52 components.Files affected
static/index.html— transport detection logic