🐛 Write the document revision to the column that exists

`set-document-revision-statement` emitted `SET d.revn`, but the column is
`revision`: the beadpot contract renames `:revn` and the DDL has followed
it since. The statement is the last one in every sync batch, so each
batch raised after its mutations had already committed, and the session's
in-memory index stayed frozen at its load-time revision.

Name the column through `nodes/cypher-property-key` rather than spelling
it, so the DDL and the statement cannot disagree again.

Found by the binder gate in the next commit, on its first run.

AI-assisted-by: mixed models
This commit is contained in:
Álvaro Tejero Cantero 2026-08-07 00:47:34 +02:00
parent 0f09b25a2e
commit c6d3651ffd
No known key found for this signature in database

View File

@ -247,9 +247,13 @@
(defn- set-document-revision-statement
"The column is `revision`, not `revn` beadpot spells the revision number out
(`schema.contract`). Named through `cypher-property-key` so the two cannot
disagree again."
[doc-id revn]
(str "MATCH (d:Document {id: " (ladybug/format-uuid doc-id) "}) "
"SET d.revn = " (ladybug/format-int revn) ";"))
"SET d." (nodes/cypher-property-key "Document" :revn) " = "
(ladybug/format-int revn) ";"))
(defn- resolve-parent-for-add
[index {:keys [parent-id frame-id page-id]}]