I’m not sure I am answering your question, but as far as I understand it, Gramps core has no two-phase commit at all — it’s a plain single-database local transaction model, and there’s nothing distributed for it to coordinate.
GrampsWebApiDb (which does have two participants, the local mirror and the remote server) can’t just reuse Gramps idea of a transaction: core’s model has no concept of “prepare on two sides, commit only if both agree.” The addon layers its own best-effort push-after-local-commit logic on top precisely because core gives it nothing here — which is the “not real 2PC, optimistic-concurrency-plus-resync instead” design covered in the previous answer.
Having said that, I did just make some changes to handle conflicts:
Before: if you edited a person on your desktop while someone else had already changed that same person on the server (or another device), the server would say “no, that’s stale” and reject your edit. Gramps would quietly grab the server’s latest version and overwrite your local copy with it — your edit just vanished from the server’s point of view, even though it briefly looked like it had gone through.
Now: when that rejection happens, Gramps still grabs the server’s latest version first (so it’s not fighting over stale data), but then it automatically tries your edit again, applied on top of that fresh version — like reapplying a sticky note to a page after someone slipped a newer page underneath it. Most of the time this just works, because most conflicts aren’t really about the same field — you edited a birth date while someone else added a source citation, say.
The one thing GrampsWebApiDb still doesn’t do: if someone genuinely edited the exact same field you did (e.g., you both changed the same person’s death date to different values), there’s no “merge” — whichever edit gets replayed last simply wins, with no popup asking you to pick. That’s the deliberate simplification: solving the common “different things changed” case automatically, while leaving the rarer “we both changed the same thing” case as a known limitation rather than building a full compare-and-merge dialog. If necessary, we can add that as well.
I also added a safety valve so it only retries once — if your edit conflicts again right after the retry (a genuinely fast-moving edit war on the same record), it gives up and logs it rather than looping forever.
Thanks for the question @csam, and hopefully this answers it.