Description
The Yjs WebSocket provider in the Editor component has no error handling for connection failures. If the WebSocket server is down or the connection drops, users get no feedback and can lose edits. Additionally, the connected state in the parent page is hardcoded to true and never updated.
Locations
frontend/src/app/projects/[projectId]/page.tsx:53 — const [connected] = useState(true) (always true, no setter)
frontend/src/components/Editor.tsx:105-111 — only listens for "sync" event, ignores "status" and connection errors
Expected Behavior
- The Editor should expose connection status changes (via callback or ref)
- Listen for
provider.on("status", ...) events from y-websocket
- Pass real connection state up to the parent
- Replace hardcoded
useState(true) with actual connection tracking
- Show disconnected status in StatusBar
- Add automatic reconnection with visual indicator
Difficulty: Medium
Description
The Yjs WebSocket provider in the Editor component has no error handling for connection failures. If the WebSocket server is down or the connection drops, users get no feedback and can lose edits. Additionally, the
connectedstate in the parent page is hardcoded totrueand never updated.Locations
frontend/src/app/projects/[projectId]/page.tsx:53—const [connected] = useState(true)(always true, no setter)frontend/src/components/Editor.tsx:105-111— only listens for"sync"event, ignores"status"and connection errorsExpected Behavior
provider.on("status", ...)events from y-websocketuseState(true)with actual connection trackingDifficulty: Medium