Files
buzz/desktop/src-tauri
Duncan 9b013006dc fix(desktop): close persona edit TOCTOU with a lock-held compare-and-swap
The pre-write authoritative refetch narrowed but could not close the
concurrent-definition-edit window: the store lock is released after the
refetch and reacquired by the write, so a writer committing in that
interval was still overwritten by a stale full-replacement input.

Thread the editor's seed-time revision through UpdatePersonaRequest and
compare it against the persisted persona inside the shared
update_persona_with, while the same store lock that guards the write is
held. Both the plain and publish edit paths get identical protection via
find_persona_for_update. A mismatch is rejected before any mutation with
a marked error the coordinator maps to the existing drift toast.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-28 15:30:07 -04:00
..