Skip to main content

history:redo

Redo a previously undone history batch via WebSocket.
Equivalent to POST /api/history/redo in REST.

Each redo re-applies the operations from the batch that was previously undone.
The undone batch is linked to the redo batch via RedoOf / RedoneBy.

Rate limits

  • Maximum 3 redo requests per 10 seconds per user.

Client → Server history:redo

{
"batchId": "f1b4232e-7c9f-4c12-9f0a-17cc0012a511"
}

Parameters:

  • batchId (UUID, required) — identifier of the undone batch to redo.
    Must refer to a batch that was previously undone by this user.

Success (ack)

{
"ok": true,
"batchId": "d2a77b31-21c5-4f9b-99ce-41078551df33",
"redoOf": "f1b4232e-7c9f-4c12-9f0a-17cc0012a511",
"diff": {
"nodes": [
{ "id": "uuid", "title": "Restored title", "version": 6 }
],
"links": []
},
"trace_id": "b9c72e551bfa"
}

Field reference

FieldDescription
batchIdID of the newly created redo batch
redoOfID of the undone batch being redone
diffDiff re-applied to client state
trace_idInternal diagnostic identifier for tracing

Error (ack)

{
"ok": false,
"error": "conflict.not_undone",
"message": "Batch is not in undone state",
"trace_id": "b9c72e551bfa"
}

Errors:

CodeMeaning
bad_request.missing_batchIdMissing required field
not_found.batchBatch not found or inaccessible
conflict.not_undoneBatch is not in undone state
forbidden.access_deniedUser lacks permission
internal.exceptionInternal server error

Example (JavaScript)

socket.emit("history:redo", { batchId: "f1b4232e-7c9f-4c12-9f0a-17cc0012a511" }, (ack) => {
if (!ack.ok) return console.error("Redo failed:", ack);
console.log("Redo successful, new batch:", ack.batchId);
});

Example (Python)

import socketio

sio = socketio.Client()

@sio.event
def connect():
print("connected")
sio.emit("history:redo", {"batchId": "<uuid>"}, callback=lambda ack: print("ACK:", ack))

sio.connect("https://synaptask.space",
headers={"Authorization": "Bearer <API_TOKEN>"},
transports=["websocket"])
sio.wait()

See also history:undo