livqenoDocs

ChatTroubleshooting

Chat Troubleshooting

Fixes for the most common chat problems.

Use this page when chat doesn't behave the way you expect. Find your symptom below; each section explains what's going on and how to fix it.

Before you start, check two things. They solve most problems:

  1. Listen for error events in your app. Most failures are reported there, not thrown. See Chat Events.
  2. Check membership. A user who isn't a member of a conversation gets ROOM_NOT_FOUND, not "forbidden". See Members.
SymptomJump to
ROOM_NOT_FOUND on connect or sendUser can't see the conversation
Duplicate messages after a retryDuplicates
Gaps after reconnectingMissed messages
Others don't see my messageMessage not showing
Can't edit or deleteEdit / delete fails
Connection closes with 4403Origin refused
User still shows onlineStale presence

"I get ROOM_NOT_FOUND for a conversation that exists"

Livqeno answers "not found" to users who aren't members, so outsiders can't learn which conversations exist. Check, on your backend:

  1. The conversation has members. One created without members is locked to everyone. See Conversations.
  2. This user is a member: listMembers('support-room-42').
  3. The userId in addMember and in createToken match exactly.
  4. The token response's pendingMembership is empty.
  5. Your API key and the user's token are for the same environment.

"My retried send created a duplicate message"

This shouldn't happen. Retries are caught on the server.

  1. Make sure you retry with the same clientMessageId. A new id each time means a new message. See Messages → Idempotency.
  2. If it still happens every time, it's a bug. Please report it.

"I reconnected and missed messages"

The SDK catches up for you after a reconnect. Missed messages arrive through the normal message event. When catch-up ends, recovered fires:

chat.on('recovered', (summary) => {
  if (summary.gap) reloadView();       // some history was skipped
  // summary.errors: rooms that will retry on the next reconnect
});

If you use the raw WebSocket instead of the SDK, load what you missed with a cursor. See Message History.

"A message I sent isn't showing up for other users"

  1. Listen for error events. A refused message never comes back as a message event. If you only listen for success, you miss the failure.
  2. Check the token. It needs chat:send for that conversation. See Authentication.
  3. Check the other user is connected to the same conversation. They only get live events for conversations they joined in connect(). Otherwise they'll see it later in history.

"Deleting or editing someone else's message fails"

This is expected:

  • Only the author can edit.
  • Deleting someone else's message needs chat:moderate (a MODERATOR or ADMIN). See Moderation.

"The connection closes with 4403"

Your site's address (its origin, like https://app.example.com) isn't on the project's allowed list. The token is fine, and retrying won't help. Add the origin under Project Settings → Security → Allowed Origins. localhost is allowed by default. See Browser security.

"Someone still shows online after closing the tab"

If the tab closed without a clean disconnect, the server finds out when their presence expires. That takes up to 45 seconds. See Presence.

Still stuck?

  • Look up the error code in Errors.
  • Debug the raw frames with WebSocket Protocol.
  • When you report a bug, include your SDK version. Import it and log it: import { CHAT_SDK_VERSION } from '@livqeno/chat'; console.log(CHAT_SDK_VERSION);