A sent message animates in once, not twice

Fixkamo-internal
Shipped
August 24, 2026 at 10:09 PM UTC
Author
kamo
Commit
40f8db1

The message list keyed each row on the message id, and a sent message's id changes exactly once — the optimistic row is appended under a local id, and the STOMP echo (or the send response) re-keys it to the server's. React reads that as one row leaving and a different row arriving, so it tore the element down and mounted a new one, and the new one ran the mount-time entrance spring again. The member watched their own message pop in twice. Rows now key on `localId ?? id`: @kamo/chat-core 0.1.7 carries the id a row was created under for the life of the row, so a message sent from this window keeps one element from optimistic to confirmed, and a message that arrived still keys on its server id. The test asserts element identity rather than the animation — if the DOM node survives the id change, nothing remounted and nothing can replay.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing