Messages queued server-side during disconnect and delivered in order on reconnection
Why it matters
A user who loses connectivity for 30 seconds and reconnects finds the conversation with a gap — every message sent during their outage is gone with no indication it was missed. This is especially damaging in moderation workflows, incident channels, or any context where missing a message has operational consequences. ISO 25010 reliability specifically covers data persistence across failure events; dropping messages on disconnect is a reliability failure regardless of how brief the outage.
Severity rationale
Medium because messages sent to disconnected users are permanently lost without a server-side queue, creating silent data gaps on reconnect.
Remediation
Persist messages for offline users and flush the queue in delivery order on reconnect. For production use, back the queue with Redis lists rather than in-process Maps.
// On connect, deliver queued messages in order
socket.on('connect_post_auth', async () => {
const queued = await redis.lrange(`offline:${socket.userId}`, 0, -1);
for (const raw of queued) {
socket.emit('message', JSON.parse(raw));
}
await redis.del(`offline:${socket.userId}`);
});
// When a message is sent, queue for offline subscribers
const offlineUsers = await getOfflineChannelMembers(channel);
for (const uid of offlineUsers) {
await redis.rpush(`offline:${uid}`, JSON.stringify(message));
await redis.expire(`offline:${uid}`, 86400); // 24 h TTL
}
Set a TTL on the queue to prevent unbounded growth for users who never reconnect.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Real-Time Communication Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability.recoverability — Recoverability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-realtime·automated