CMS / foldkit-cms-drizzle
Saving a draft
CmsSaveDraft writes the working copy, valid or not. The client names something
new (Cms.newEntryId()), and the first save of an id nobody has makes the entry.
- A save names what it was made from (
basedOn, the draft'supdatedAt). A newer one on the server means someone else saved in between, and the save is refused withCms.refusal.conflictinstead of undoing their work. It is one statement, compare and set, so two saves cannot both win. - A draft is bounded:
maxDraftSizecharacters of JSON, values and Model together, one million by default. More is refused, and nothing is written. - Two saves in the same instant still get different
updatedAts, so the next save can tell them apart. - It answers with the entry and the draft as patches, so the client holds both
with no refetch. Every operation patches the entry with its
stateand itsrevision, so what is on screen follows what was done. - Refused: a type the server does not know, an entry that is not there or is of
another type, an archived entry, and, as
Forbidden, a principal that is not an author and an author yourtransitionsorallowrefuse.
CmsDiscardDraft removes the working copy. A published entry is left as it was
published. An entry that was never published has nothing left, so it is removed
too, and the client is told both are gone.