Documents Versioning
A document moves from a local draft through sync, permission-gated actions, flagging, and one of two distinct delete outcomes — "for me" or "from everyone." Every view, download, delete or share passes through the same approval gate, driven entirely by the document's canX permission policy.
State diagram
stateDiagram-v2
[*] --> LocalDraft
LocalDraft --> Uploading : save / create
Uploading --> Synced : server acknowledges
Synced --> Modified : local rename / edit
Modified --> Uploading : re-sync
Synced --> Flagged : member flags document
Flagged --> Synced : flag dismissed
Flagged --> DeletedForEveryone : flag upheld by organiser
state ActionGate <<choice>>
Synced --> ActionGate : view / download / delete / share
ActionGate --> PendingApproval : approval required (canX policy)
ActionGate --> ActionCompleted : no approval required
PendingApproval --> ActionCompleted : organiser approves
PendingApproval --> ActionDeclined : organiser declines
ActionDeclined --> Synced
ActionCompleted --> Synced : view / download / share
ActionCompleted --> DeletedForMe : delete "for me"
ActionCompleted --> DeletedForEveryone : delete "from everyone"
DeletedForMe --> [*]
DeletedForEveryone --> [*]
States
| State | Meaning |
|---|---|
| LocalDraft | Created or captured on-device, not yet uploaded. |
| Uploading | In transit to the server; sync indicator shows unsynced. |
| Synced | Steady state — server and device agree on content and metadata. |
| Modified | Renamed or edited locally since the last successful sync. |
| Flagged | Reported by a member under one or more flag categories, pending review. |
| PendingApproval | An action (view/download/delete/share) is queued for organiser sign-off. |
| ActionCompleted / ActionDeclined | Outcome of the approval gate. |
| DeletedForMe | Removed from the requesting member's view only. |
| DeletedForEveryone | Terminal — removed for every member with access. |
Reading the diagram
Syncedis the steady state; the cloud sync indicator is solid wheneversync < created || sync < updated || sync < deleted.- Every gated action (
canView,canDownload,canRename,canDelete,canShare) passes through the sameActionGate— approval is a policy check, not a separate feature. DeletedForMeonly unwinds the current user's view;DeletedForEveryoneis the terminal state for the document itself.