Skip to content
Français

recoverStorageReservation

import { recoverStorageReservation } from "@elie-laloum/outpost/recovery";

Remove one inspected reservation after explicit confirmation that its owner stopped. Require the exact ledger revision and use a conditional write; concurrent changes reject with TransportConflict. Other entries remain intact. Legacy entries require stopping all potential owners because their identity is unknown. Never infer remote liveness from a PID.

Complete example and detailed rules.

  • transporterRequired
    Transport
    The same Transport used to inspect the reservation ledger.
  • optionsRequired
    StorageReservationRecoveryOptions
    Reservation identity, inspected ledger revision and explicit stopped-owner authorization.
  • options.idRequired
    string
    Exact reservation ID selected from the inspection.
  • options.revisionRequired
    string
    Exact ledger revision returned by inspection; any intervening mutation invalidates it.
  • options.processesStoppedRequired
    true
    Explicit confirmation that the selected owner stopped; for legacy entries, stop all potential writers before recovery.

Promise<void>

export declare function recoverStorageReservation(
  transporter: Transport,
  options: StorageReservationRecoveryOptions,
): Promise<void>;