Move row writes to core-data - #406
Draft
priethor wants to merge 9 commits into
Draft
Conversation
priethor
force-pushed
the
priethor/add/row-writes-core-data
branch
from
July 30, 2026 17:37
333d63b to
7b68a8d
Compare
The subregistry makes it look like row saves are split across two stores, so the previous note claimed property saves and grid saves ended up in different queues. They do not. EditorProvider builds that subregistry with only core/block-editor and core/editor and falls back to the root registry, so core-data resolves to the root from either side and every row save shares the same per-record lock. Left the reasoning in the doc rather than just deleting the claim, since the subregistry really does suggest the opposite and the next person reading it would wonder.
Preparing the record runs an internal REST request with the full row enrichment behind it, so the cost is worth stating next to the call rather than leaving someone to find it. Also explains why a null there still leaves the duplicate successful, which was deliberate and not obvious.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Part of #298.
Row edits and row creation now use core-data. Duplicate, trash, and restore also add the canonical response record to the entity cache. The grid still reads full rows from
/cortext/v1/rowsand keeps its existing refresh path, so this PR does not change how collections load.Why
Rows are
crtxt_documentrecords, the same entities shown in the grid and opened in the side peek or full editor. Direct REST writes bypasscore-data, so its cached copy can fall behind the server and Cortext has to keep each surface in sync by hand. Writing throughcore-datakeeps the saved record in the entity store, which is required before the grid can read from it.How
Field saves send only the changed title or field and use
throwOnErrorso the existing UI can report failures. The duplicate response now includes a canonicalpostwithout changing the rest of its envelope, and lifecycle actions cache only canonical records returned by the server.Testing Instructions