ID tiebreaker for same-second messages

This commit is contained in:
Jack Kingsman
2026-03-03 11:57:53 -08:00
parent 21fd505fb9
commit ea49bdff35

View File

@@ -314,7 +314,7 @@ export function MessageList({
// Note: Deduplication is handled by useConversationMessages.addMessageIfNew()
// and the database UNIQUE constraint on (type, conversation_key, text, sender_timestamp)
const sortedMessages = useMemo(
() => [...messages].sort((a, b) => a.received_at - b.received_at),
() => [...messages].sort((a, b) => a.received_at - b.received_at || a.id - b.id),
[messages]
);