The send flow now hits two paths concurrently: 1. `POST /api/matches/:id/messages` returns the persisted message. 2. The server broadcasts `dating.message.created` to every match member, including the sender. Whichever arrives first adds the message to the timeline; whoever arrives second was supposed to detect the duplicate and skip. The WebSocket handler already gated on `messages.some(id === incoming.id)`, but the POST branch unconditionally appended — so when WS won the race the POST branch produced a duplicate keyed entry and Svelte threw `each_key_duplicate` at indexes 10/11. Fix: the POST branch now performs the same dedup check before appending. Whichever path lands first wins; the other no-ops. The optimistic bubble is still removed by `clientNonce` in both paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>master
parent
00b0544a46
commit
869a9b320b
Loading…
Reference in new issue