function releaseReservation
releaseReservation(sessionId: string): Promise<void>

Release an in-progress reservation so the very next delivery can re-claim it. Deletes only a still-unresolved row, so it never clobbers a finalized success or a recorded terminal failure that a racing delivery may have written.

Two callers:

  • reserveSession releases a stale reservation (abandoned by a crashed process) before retrying the claim.
  • the webhook releases a fresh reservation whose refund of a real payment just failed: recording no outcome but holding the lock would make the next redelivery collide and return 409 until the row goes stale (~5 min), gating refund recovery on a local timer instead of provider redelivery.

Parameters

sessionId: string

Return Type

Promise<void>

Usage

import { releaseReservation } from "docs/database.ts";