Prompt
How do I debug a message that says sent but never shows up for the user?
Latest observation
If a message says “sent” but the user never sees it, the problem is usually in one of four places:
- Your app marked it sent, but the server never actually delivered it
- It was delivered but filtered/hidden on the client
- It went to the wrong recipient/thread
- There’s a delay or sync issue
Here’s a practical way to debug it:
1) Verify what “sent” means
Check whether “sent” means:
- queued locally
- accepted by your backend
- successfully delivered to the recipient
- read by the recipient
A lot of bugs come from using “sent” too early. The UI may show sent when the message is only stored locally or accepted by your API, not actually delivered.
2) Trace the full message path
Follow the message end to end:
Client A → API/server → database/queue → delivery service → Client B
For each step, confirm:
- message ID exists
- recipient ID is correct
- thread/conversation ID is correct
- status transitions are happening as expected
If you have logs, search by the message ID and compare:
- created
- enqueued
- delivered
- failed
- acknowledged
3) Check recipient targeting
Common issues:
- wrong user ID
- wrong conversation/thread
- stale device token
- recipient blocked sender
- message routed to a different account/session
Confirm the recipient is actually subscribed/connected to the channel you expect.
4) Inspect client-side filtering
The recipient app may be receiving the message but not rendering it because of:
- filters by conversation type
- unread/archived state
- message hidden by moderation rules
- duplicate suppression
- timestamp ordering issues
- UI not refreshing state after receipt
Check the raw incoming payload before it reaches the UI.
5) Check delivery acknowledgements
If your system supports ACKs:
- did the recipient client acknowledge receipt?
- did the server get that ACK?
- did the sender client interpret the ACK correctly?
Sometimes the message is delivered, but the sender UI never receives the status update.
6) Look for transport failures
Depending on your stack:
- WebSocket disconnected
- push notification failed
- pub/sub message dropped
- queue retry exhausted
- timeout during delivery
Check:
- connection status
- retry logs
- dead-letter queue
- rate limits
- push provider errors
7) Validate message payload
Make sure the message itself is valid:
- not empty or malformed
- supported content type
- encoded correctly
- not exceeding size limits
- not rejected by content moderation/spam filters
8) Confirm ordering and deduplication
If you dedupe messages by ID or timestamp, a valid message may be accidentally discarded as a duplicate.
Check:
- duplicate message IDs
- clock skew between devices
- out-of-order arrival
- optimistic UI rollback
9) Reproduce with a minimal test
Try:
- one sender
- one recipient
- one message type
- one device/session
- logging enabled on both ends
If the bug disappears, add complexity back until it fails.
10) Add better observability
Useful debugging additions:
- unique message ID
- correlation ID across services
- structured logs for every state change
- delivery metrics
- client-side receipt logs
- error codes for failed delivery
Quick checklist
Ask:
- Was the message actually accepted by the server?
- Did it reach the recipient device/session?
- Did the recipient app receive it?
- Did the UI render it?
- Was it hidden or filtered?
- Did the recipient get an ACK?
- Is the status stuck due to a sync bug?
If you want, I can help you debug this for a specific system like:
- SMS
- Slack/Discord-style chat
- WebSocket chat app
- Firebase/Firestore messaging
- WhatsApp/Telegram-like architecture