Sanity Library Reference Docs
    Preparing search index...

    A claim on a pending effect — presence means a drainer has taken dispatch responsibility for the entry. Absence means the entry is available. There is intentionally no status enum; presence of claim is the sole marker.

    Wire format includes _type so future fields can land additively without parsing strings.

    interface PendingEffectClaim {
        _type: "pendingEffect.claim";
        claimedAt: string;
        claimedBy: Actor;
        claimToken?: string;
        leaseExpiresAt?: string;
    }
    Index

    Properties

    _type: "pendingEffect.claim"
    claimedAt: string
    claimedBy: Actor
    claimToken?: string

    The exact-claim identity a mid-dispatch state report must present. effectKey cannot serve: a lease takeover keeps the same key, so a superseded handler holding only the key could still write. The token is minted fresh on every claim and takeover; commitEffectOps rejects a report whose token no longer matches before writing anything. Absent only on claims persisted before tokens existed — those never match, so their dispatches simply cannot report mid-flight.

    leaseExpiresAt?: string

    When this claim's lease lapses. Past this instant the claimer is presumed dead: a drain may take the claim over and sweepStaleClaims may force-release it. Absent only on claims persisted before leases existed — treated as already expired, so the exact entries leases exist to recover (claimed-then-abandoned) stay recoverable.

    There is deliberately no attempt counter here: the retry count is the effectClaimReleased history rows for the entry's _key (plus the live claim), and a field would drift from that trail across releases.