Edits made while disconnected are silently lost on reload — no prominent warning, no leave-page confirmation
Description
When the collaboration websocket drops while a user is editing, the editor keeps accepting input — those edits exist only in browser memory. If the user then reloads the page, navigates away or closes the tab (which is a common reaction to seeing the browser/OS show "no internet"), everything typed during the dead window is silently discarded. The server later persists the partial state as a new revision, so the loss is permanent and does not appear in history.
We verified this server-side on a self-hosted instance: content typed during a 15-minute websocket dead window never arrived on any subsequent connection, and the revision created afterwards contained only the pre-drop prefix of a paragraph.
Two UX gaps make this worse:
- The only disconnect indicator is a small "Offline" pill in the document footer (
ConnectionStatuscomponent), which isdisplay: nonebelow thetabletbreakpoint — on narrow windows there is no indication at all, and even when visible it is easy to miss (tooltip only on hover). - There is no
beforeunloadconfirmation for documents with potentially unsynced edits. The codebase already uses this pattern inTemplateFormfor unsaved template changes, but not for collaborative documents.
Steps to reproduce
- Open a document for editing.
- Break the websocket connection only (e.g. block the
/collaborationws request in devtools, or drop server reachability while keeping the page open). - Keep typing. Note the near-invisible footer indicator.
- Reload the page.
- Everything typed in step 3 is gone; the server never received it.
Expected behavior
- A prominent, persistent banner (not a footer pill) while
multiplayerStatusisconnecting/disconnectedon an editable document, shown at all viewport widths, telling the user edits are not syncing yet. - A
beforeunloadconfirmation ("Leave site? Changes you made may not be saved") while there may be unsynced local changes — e.g. while the multiplayer status is notconnected, or the local ydoc has updates not yet acknowledged by the server.
Related
- #5830 — data loss with zero client-side warning (closed, still receiving reports)
- #12106 — same report ("connection lost with no warning"), closed
- #13464 — clicking Done destroys the websocket before final edits sync
Unlike those reports, this issue is specifically about the missing warning/guard UX, which is reproducible on demand and cheap to fix.
Environment
Self-hosted, multiplayer collaboration enabled, recent version (self-built image).
Source: outline/outline