mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-24 19:41:14 +02:00
Under READ COMMITTED, two concurrent resolves of different comments in the same thread could each miss the other's uncommitted resolution in ClearOtherThreadResolutions and commit two resolved rows. Take a FOR UPDATE lock on the thread root in its own statement before clearing, so the loser blocks and its clear re-runs on a fresh snapshot that sees the winner's committed resolution. Also updates the stale loadCommentForActor docstring that still described the backend as a plain setter with frontend-derived resolution — the single-resolution invariant is now enforced on write. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>