Common Chat Functionality Bugs and How to Catch Them

Common Chat Functionality Bugs and How to Catch Them

January 26, 2026 · 19 min read · Common Issues

Common Chat Functionality Bugs and How to Catch Them

Overview of Chat Functionality Bugs

Chat features sit at the heart of many modern applications, from customer‑support portals to social networks and internal collaboration tools. Because they combine real‑time networking, stateful UI components, media handling, and accessibility concerns, they expose a wide variety of defects that often slip through scripted test suites. This guide walks through the most frequent chat‑specific bug patterns, explains why each arises, shows how users experience the problem, and provides reproducible steps, detection tactics, and remediation advice.

The goal is to give you a practical test matrix you can copy into your test plan, a set of manual checks you can run today, and automation snippets that integrate with common frameworks (Appium, Playwright, Selenium). By the end you will have a concrete checklist and a deeper understanding of how persona‑driven autonomous exploration—such as the approach used by SUSATest—can surface issues that deterministic scripts miss.

---

Bug Pattern 1: Message Loss Under High Load

Why it happens

When a chat server receives a burst of messages—often triggered by a notification storm, a bot flood, or a sudden spike in active users—its inbound queue can overflow if the consumer side (the process that writes to persistent storage) cannot keep up. Many implementations use a simple in‑memory buffer with a fixed size; once the buffer fills, incoming payloads are dropped without acknowledgment to the sender.

User impact

Users see their sent messages disappear from the conversation view, while the remote party never receives them. In group chats, the loss may appear to the loss can be asymmetric, leading to confusion about who said what.

How to reproduce

  1. Open two client instances (A and B) logged into the same chat room.
  2. From a third scripted client (C) send a rapid burst of 500‑1000 text messages in under 5 seconds using a loop that calls the send API without waiting for acknowledgments.
  3. Monitor the message count stored in the database for the room and compare it to the number sent from C.
  4. Observe that the count plateaus well below the number of sent messages.

A reproducible Bash snippet using curl (assuming a REST endpoint /api/messages) looks like:


#!/usr/bin/env bash
ROOM_ID="room123"
TOKEN="Bearer <your‑token>"
for i in {1..800}; do
  curl -s -X POST "https://chat.example.com/api/messages" \
    -H "Authorization: $TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"room_id\":\"$ROOM_ID\",\"body\":\"load‑test $i\"}" &
done
wait

Detection strategies

Fix and prevention

---

Bug Pattern 2: Duplicate Message Delivery

Why it happens

Duplicates commonly arise when the client’s retry logic does not deduplicate based on a stable message identifier. If a network glitch causes the original POST to timeout, the client may resend the same payload; the server, lacking a unique constraint on (room_id, client_message_id), stores a second copy.

User impact

The conversation view shows the same text bubble twice in a row, which can be misleading—especially when the duplicate contains a timestamp that appears to go backwards. In moderation contexts, duplicated spam or abusive content may trigger false‑positive alerts.

How to reproduce

  1. Enable artificial latency on the network interface (e.g., using tc on Linux) to add 200 ms delay and occasional packet loss.
  2. Send a single message from client A while the latency is active.
  3. Observe that the client times out after its default timeout (often 5 s) and automatically retries.
  4. Check the server logs or database: two rows with identical client_message_id exist.

A minimal tc command to add delay and loss:


sudo tc qdisc add dev eth0 root netem delay 200ms loss 10%

After the test, remove the rule:


sudo tc qdisc del dev eth0 root netem

Detection strategies

Fix and prevention

---

Bug Pattern 3: Incorrect Timestamp Handling

Why it happens

Chat applications often rely on device clocks to display timestamps, then send those values to the server for persistence. When clients operate in different time zones or have incorrect system time, the server may store the raw client‑supplied timestamp, leading to ordering issues when messages are later sorted by that field. Some backends also convert timestamps incorrectly between UTC and local zones during retrieval.

User impact

Messages appear out of chronological order, causing confusion in fast‑moving threads. In support tickets, a reply may seem to precede the original inquiry, making it difficult for agents to follow the conversation.

How to reproduce

  1. Set the system clock on client A to be 5 minutes ahead of UTC.
  2. Send a message from client A at 12:00 UTC (according to a reliable external source).
  3. Send a second message from client B (clock correct) at 12:01 UTC.
  4. Retrieve the message list via the API and observe that the message from A appears after B’s, despite being sent earlier in real time.

A quick way to shift the clock on macOS for testing:


sudo date -u 12050000   # sets date to Dec 5 00:00:00 UTC

Remember to revert after testing.

Detection strategies

Fix and prevention

---

Bug Pattern 4: Message Ordering Issues

Why it happens

Even with correct timestamps, ordering can break when the client processes incoming messages from multiple sources (WebSocket, long‑poll, REST fallback) and merges them into a single list without respecting sequence numbers. If the transport does not guarantee delivery order (e.g., UDP‑based signaling or a message broker that allows out‑of‑order delivery), the UI may show older messages after newer ones.

User impact

Conversations become hard to follow; users may respond to outdated information, leading to repetitive exchanges or missed context. In threaded discussions, replies may appear under the wrong parent message.

How to reproduce

  1. Configure the chat server to add a random delay (0‑500 ms) to each outgoing WebSocket frame for a specific user (use a proxy like toxiproxy).
  2. Have three clients (A, B, C) send messages in rapid succession: A→B→C.
  3. Observe the UI on a fourth client (D) that subscribes to the room; the messages may appear as C, A, B or another permutation.

Example toxiproxy command to add jitter:


toxiproxy-cli create chat-proxy -l localhost:8080 -u upstream:8080
toxiproxy-cli toxic add chat-proxy --type latency --attribute latency=200ms --attribute jitter=300ms

Detection strategies

Fix and prevention

---

Bug Pattern 5: Failed Message Retry Logic

Why it happens

Clients often implement exponential back‑off retries for failed sends, but they may neglect to clear the retry timer when the user manually deletes the message or navigates away from the chat view. Consequently, a stale retry attempt can fire after the message has been removed, causing a phantom send or an error dialog that confuses the user.

User impact

Users see an error toast (“Failed to send message”) for a message they already deleted, or they notice a duplicate send attempt that appears out of nowhere. In some cases, the retry can resend a message containing sensitive data after the user thought it was discarded.

How to reproduce

  1. In the chat UI, type a message and hit send.
  2. Immediately after tapping send, swipe left to delete the message from the composer before the network call completes.
  3. Disable network connectivity (e.g., toggle airplane mode) to force the send to fail.
  4. Wait for the client’s retry interval (often 5‑10 seconds) and then re‑enable network.
  5. Observe whether a retry occurs despite the message being deleted.

A script to toggle network on Android via ADB:


# disable wifi
adb shell svc wifi disable
# wait 8 seconds
sleep 8
# re-enable wifi
adb shell svc wifi enable

Detection strategies

Fix and prevention

---

Bug Pattern 6: Presence Indicator Glitches

Why it happens

Presence (online/away/typing) is usually conveyed via lightweight packets (e.g., WebSocket ping/pong or custom presence events). If the client fails to send a presence-offline when the app goes to the background or the process is killed, the server may continue to show the user as online. Similarly, typing indicators can linger if the typing-stop event is not dispatched after a timeout or when the user navigates away.

User impact

Contacts see stale presence, leading to misguided expectations (e.g., expecting an immediate reply when the user is actually offline). Persistent typing indicators can cause anxiety or make users think the other party is stuck composing a message.

How to reproduce

  1. Have two clients (A and B) logged in and showing each other as online.
  2. Put client A into the background (press home button) or kill its process via task manager.
  3. Observe the presence indicator on client B: does it change to “offline/away” within the expected timeout (usually 30‑60 seconds)?
  4. For typing, start typing in A’s composer, then navigate to another screen without sending; check whether B’s typing indicator disappears after the configured idle period (often 3 seconds).

Detection strategies

Fix and prevention

---

Bug Pattern 7: Media Upload/Download Failures

Why it happens

Chat platforms frequently allow users to share images, videos, or files. Uploads typically go through a multipart POST to a storage service (e.g., S3, Azure Blob). Failures can stem from:

User impact

Users see a stuck progress bar, a generic “Failed to send” toast, or a broken image placeholder. In group chats, a missing media file can break the flow of a conversation (e.g., a product image in a sales chat).

How to reproduce

A curl example to simulate a bad content type:


curl -X POST https://chat.example.com/api/media \
  -H "Authorization: Bearer <token>" \
  -F "file=@/tmp/fake.txt;type=image/png" \
  -F "room_id=room123"

Detection strategies

Fix and prevention

---

Bug Pattern 8: Accessibility Violations in Chat UI

Why it happens

Chat interfaces often rely heavily on custom components (message bubbles, avatars, reaction bars) built with

and CSS, bypassing native semantic elements. Common omissions include missing aria-label on action buttons, insufficient color contrast for text inside bubbles, lack of keyboard‑navigable focus order, and missing live region announcements for incoming messages.

User impact

Users who depend on screen readers or keyboard navigation may be unable to send messages, hear new arrivals, or interact with reactions. This can lead to exclusion, especially in accessibility‑regulated sectors (government, education, healthcare).

How to reproduce

Example axe CLI command:


npx axe-cli https://chat.example.com/rooms/room123 > axe-report.json

Detection strategies

Fix and prevention

---

Bug Pattern 9: Security Flaws (e.g., XSS in chat)

Why it happens

Chat messages often accept rich content (markdown, HTML, emojis). If the application renders user‑supplied markup without proper sanitization, an attacker can inject scripts that execute in the context of other users (stored XSS). Similarly, insufficient validation of URLs in link previews can lead to SSRF or malicious redirects.

User impact

Compromised accounts, session hijacking, defacement of the chat interface, or exfiltration of data. In enterprise environments, a single XSS payload can spread to many users quickly.

How to reproduce

A quick test using curl to post a malicious payload:


curl -X POST https://chat.example.com/api/messages \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"room_id":"room123","body":"<script>alert(1)</script>"}'

Detection strategies

Fix and prevention