Real-time WebSocket

Messages appear instantly without refresh

3 min read

FreeMaint Chat uses a Socket.IO WebSocket connection to deliver messages, edits, deletes and typing events instantly. No page refresh needed.

Events you receive

  • chat:new โ€” a new message arrives in a conversation you're subscribed to
  • chat:edited โ€” someone edited a message
  • chat:deleted โ€” someone soft-deleted a message (replaced by a tombstone)
  • chat:typing โ€” someone in the conversation is currently typing

Polling fallback

If your WebSocket connection drops (network blip, lock screen), the frontend keeps a 30-second polling resync as a safety net. Once the WebSocket reconnects, polling becomes silent again.

Room scoping

Each conversation is its own Socket.IO room (chat:companyId:conversationId). When you open a conversation, the client subscribes; when you switch, it unsubscribes. Membership is verified server-side at subscribe time โ€” non-members can't eavesdrop.

Was this page helpful?