History
History in SynapTask provides undo/redo and auditing for all graph changes.
Behavior
- Each mutation creates a batch (a set of operations).
- Each batch stores:
forward— the applied changes.inverse— the reverse changes (for undo).
- Undo applies the
inverse. - Redo re-applies a previously saved batch.
Retention
The length and size of retained history depend on the subscription plan:
- Basic: 1 day • 100 actions • 20 MB
- Plus: 30 days • 5,000 actions • 200 MB
- Pro: 180 days • 50,000 actions • 800 MB
Use cases
- Undo accidental node deletion.
- Redo a branch merge.
- Audit collaborator changes.
Operation Types
All operations are stored as integers int.
ScopeType
Defines the visibility boundary of a history batch:
0 = USER— private user actions only.1 = GRAPH— changes in the graph (nodes/links).2 = PAGE— content/page updates.
EntityType
The entity family for the operation:
0 = NODE— graph node (task/item).1 = LINK— graph link (edge).2 = GRANT— access grants.3 = USER— user-level settings.
Operation types
Operation codes across all entity types:
0 = NODE_ADD1 = NODE_UPDATE2 = NODE_STATUS3 = NODE_TRASH4 = NODE_RESTORE5 = NODE_DELETE6 = NODE_PUBLISH10 = LINK_ADD11 = LINK_TYPE12 = LINK_UPDATE13 = LINK_TRASH14 = LINK_RESTORE15 = LINK_DELETE16 = LINK_SWAP20 = GRANT_UPSERT21 = GRANT_UPDATE22 = GRANT_DELETE30 = USER_UPDATE40 = PAGE_UPDATE
Example Batch JSON
{
"batchId": "uuid",
"actor": {
"username": "alice",
"email": "alice@example.com"
}
"ts": "2025-09-25T12:00:00Z",
"nodes": [
{
"op": 0, // NODE_ADD
"before": {},
"after": {
"ID": "node-uuid",
"Title": "New task",
"Status": 0,
"Version": 1
}
},
{
"op": 3, // NODE_TRASH
"before": {"ID": "other-node", "InTrash": false, "Version": 2},
"after": {"ID": "other-node", "InTrash": true, "Version": 3}
}
],
"links": [
{
"op": 11, // LINK_UPDATE
"before": {"ID": "link-uuid", "WasBlocker": false, "Version": 1},
"after": {"ID": "link-uuid", "WasBlocker": true, "Version": 2}
}
],
"user": [],
"access": [],
}
This structure allows to:
- Display audit trails.
- Support undo/redo on the client side.
- Build advanced collaboration views with full diff history.