Expand description
Diff preview / confirmation framework.
§Overview
High-impact property edits (storage class change in v1; future: lifecycle, ACL, metadata bulk-edit) go through a two-phase flow:
-
Create: caller invokes
diff_preview_createwith a description of the proposed change → backend persists aDiffRecordin theDiffStoreand returns aDiffId. -
Confirm or Cancel:
- Confirm: the mutating command (e.g.
object_set_storage_class) callsDiffStore::consumewith the id. Consume succeeds only once and only for records in thePendingstate. - Cancel:
diff_preview_cancelsets the status toCancelled. Any subsequentconsumecall returnsNone.
- Confirm: the mutating command (e.g.
§OCP
DiffPayloadis open for new kinds (metadata bulk-edit, ACL change). Adding a new kind is one new variant here + one new parsing branch indiff_cmd.rs+ one new rendering branch in the frontend modal.DiffStore::consumeis the single safety gate. Every mutating command that uses the diff framework must callconsume— it is the authoritative check for cancelled/expired/double-confirm rejection.
Structs§
- DiffId
- Opaque diff identifier — a UUID v4 string.
- Diff
Object Ref - A reference to a single S3 object used in diff payloads.
- Diff
Record - A persisted diff entry in the
DiffStore. - Diff
Store - In-memory store for pending diff records.
- Diff
Store Handle Arc-wrappedDiffStoremanaged by Tauri.
Enums§
- Diff
Payload - Describes what change a diff is proposing.
- Diff
Status - Lifecycle status of a diff record.
Constants§
- DEFAULT_
DIFF_ TTL_ SECS - Default TTL for diff records: 5 minutes.