Skip to Content

Interface RevertResult

What MemoryOperations.revertMemory returns.

Holding one of these means the call succeeded, so the thing that bites is reading the absence of an exception as success. NOT_FOUND, EXPIRED and REFUSED all arrive as an outcome on a call that did not throw.

The outcome names the effect rather than what was asked for: undoing a single write can take its whole memory with it, when the insight it added was the last one that memory held.

const reverted = await client.memory.revertMemory(operationId)
switch (reverted.outcome) {
case RevertOutcome.NOT_FOUND:
console.log('ingestion may still be running; try again shortly')
break
case RevertOutcome.EXPIRED:
console.log('outside the revert window')
break
default:
console.log(RevertOutcome[reverted.outcome])
}
interface RevertResult {
    operationId: string | null;
    outcome: RevertOutcome;
    instructions: Instructions;
}
Index
operationId: string | null

The operation id that was addressed.

outcome: RevertOutcome

What the revert actually removed.

Every outcome is a successful call: NOT_FOUND, EXPIRED and REFUSED report a caller-visible state, not a service failure.

instructions: Instructions

What the service asks the caller to do next.