pub async fn commit_edit<E>(
store: &dyn ObjectStore,
cfg: &LeanConfig,
flush: &str,
edit: impl Fn(Option<&LoadedManifest>, &mut LeanManifest) -> Result<(), E>,
) -> Result<(), EditError<E>>Expand description
ONE manifest CAS for an edit by a party that holds no lease (P2): the
gateway’s UI saves, deletes and renames, and the ingress sweep’s
adoptions. Load the current document; let edit judge it and change a
copy — the next generation, with the installing party’s fields reset as
merge resets them; keep tombstones to TOMBSTONE_KEEP_SEQS; CAS it in
with epoch 0; on a lost race do it all again against what won, so every
precondition is judged against the document the CAS replaces.