How does SyncNow stop an agent from overwriting someone else's work?

To replace, edit, move onto or delete an existing file, a write must prove which revision it is replacing, and the server checks that proof against the live file at the moment of writing.

The proof is either an if_match with the SHA-256 the agent expects, or the exact revision that the same session read or wrote last. Being the same team member or the same PC is not enough.

Without a proof the write is refused with BASELINE_REQUIRED, and if the file changed since the session read it, with STALE_CONTEXT. If the session's own reads show that someone else changed the file while it was open, the write is refused with CHANGED_UNDER_YOU until the agent reads it again or names the revision it is knowingly replacing. Because the comparison is always with the live file, this compare-and-swap catches changes by other agents, by anyone working by FTP and by the site itself.

Each refusal means nothing was written: the agent re-reads the file, re-applies its change to the current content and sends it again. Appending, bumping a number and touching a timestamp need no baseline, because they replace nothing the agent read. If a bad overwrite still happens, the previous content can often be put back: see Can I get back a file that an agent overwrote?.


What does SyncNow check before an agent's edit reaches my site?
Can two agents edit the same file at the same time?
Getting Started
Projects and the Workspace
Agents and Work Sessions
Planning
Rules
Activity, History and Insights
Managers and Teamwork
Connections, Credentials and Security
Source, Safe Editing and Recovery
Updates, Reports and Troubleshooting