Follow-up from #87, criterion 2
#87's second acceptance criterion asked for two things: a useful proposed-vs-current diff on genuine conflicts, and a sanity check on metadata ordering. The diff half shipped and is tested (docsChangePrecision.js:471-488, replaceDocumentWithMarkdown.js:298-329, covered by docsChangePrecision.test.js:258-279 and replaceDocumentCollateral.test.js:209-225).
The ordering check was never built. Nothing in the guard treats an impossible metadata transition as suspicious rather than as a genuine conflict.
What is missing
guardMutation compares a stored modifiedTime against the current one and treats "different" as "changed". It does not ask whether the difference is coherent:
- A
modifiedTime that moves backwards from the recorded read is not a normal edit. It means a clock skew, a Drive metadata quirk, or state from a different file, and reporting it as "modified externally since you last read it" sends the user to re-read a document that may not have changed.
- A revision id that goes backwards, or that is unchanged while
modifiedTime moved by a large margin, is similarly incoherent.
Today all of these produce the same generic staleness rejection, so a real bug in our own bookkeeping is indistinguishable from an ordinary concurrent edit.
Required outcome
- Detect metadata transitions that cannot happen under normal Drive/Docs behavior.
- Report them distinctly from a genuine conflict, so the message tells the user what actually happened rather than sending them to re-read.
- Keep failing closed. An incoherent transition must not be treated as "probably fine, allow the write".
- Cover it with tests that assert the incoherent case produces its own message, not the standard staleness text.
Context
Split out of #87 rather than holding that master issue open. The read-before-write guard is otherwise complete and verified: see the criterion-by-criterion acceptance check at #87 (comment).
Not a 3.0.0 blocker. The guard is correct today, just not maximally informative when its own inputs are nonsense.
Follow-up from #87, criterion 2
#87's second acceptance criterion asked for two things: a useful proposed-vs-current diff on genuine conflicts, and a sanity check on metadata ordering. The diff half shipped and is tested (
docsChangePrecision.js:471-488,replaceDocumentWithMarkdown.js:298-329, covered bydocsChangePrecision.test.js:258-279andreplaceDocumentCollateral.test.js:209-225).The ordering check was never built. Nothing in the guard treats an impossible metadata transition as suspicious rather than as a genuine conflict.
What is missing
guardMutationcompares a storedmodifiedTimeagainst the current one and treats "different" as "changed". It does not ask whether the difference is coherent:modifiedTimethat moves backwards from the recorded read is not a normal edit. It means a clock skew, a Drive metadata quirk, or state from a different file, and reporting it as "modified externally since you last read it" sends the user to re-read a document that may not have changed.modifiedTimemoved by a large margin, is similarly incoherent.Today all of these produce the same generic staleness rejection, so a real bug in our own bookkeeping is indistinguishable from an ordinary concurrent edit.
Required outcome
Context
Split out of #87 rather than holding that master issue open. The read-before-write guard is otherwise complete and verified: see the criterion-by-criterion acceptance check at #87 (comment).
Not a 3.0.0 blocker. The guard is correct today, just not maximally informative when its own inputs are nonsense.