KamoCRM

A reaction toggled twice at once is a no-op, not a 500

FixMediaService
Shipped
27 ஆகஸ்ட், 2026 அன்று 1:59 AM UTC
Author
kamo
Commit
3b3284f

setReaction read, then saved, then caught the constraint violation the read was supposed to prevent — which does not work: the violation surfaces at flush, after the catch, on a transaction that is already rollback-only. Two devices reacting with the same emoji at the same instant would have answered 500 and rolled the reaction back. It now goes through the shared library's ON CONFLICT DO NOTHING upsert, so the second write is a no-op and both callers get the state they asked for.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing