@trigger.dev/redis-worker 4.5.4 → 4.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2303,6 +2303,9 @@ declare class MollifierBuffer {
2303
2303
  releaseClaim(input: IdempotencyLookupInput & {
2304
2304
  token: string;
2305
2305
  }): Promise<void>;
2306
+ resetResolvedClaim(input: IdempotencyLookupInput & {
2307
+ expectedRunId: string;
2308
+ }): Promise<boolean>;
2306
2309
  readClaim(input: IdempotencyLookupInput): Promise<IdempotencyClaimResult | null>;
2307
2310
  lookupIdempotency(input: IdempotencyLookupInput): Promise<string | null>;
2308
2311
  resetIdempotency(input: IdempotencyLookupInput): Promise<{
package/dist/index.d.ts CHANGED
@@ -2303,6 +2303,9 @@ declare class MollifierBuffer {
2303
2303
  releaseClaim(input: IdempotencyLookupInput & {
2304
2304
  token: string;
2305
2305
  }): Promise<void>;
2306
+ resetResolvedClaim(input: IdempotencyLookupInput & {
2307
+ expectedRunId: string;
2308
+ }): Promise<boolean>;
2306
2309
  readClaim(input: IdempotencyLookupInput): Promise<IdempotencyClaimResult | null>;
2307
2310
  lookupIdempotency(input: IdempotencyLookupInput): Promise<string | null>;
2308
2311
  resetIdempotency(input: IdempotencyLookupInput): Promise<{
package/dist/index.js CHANGED
@@ -17000,6 +17000,20 @@ var MollifierBuffer = class {
17000
17000
  const claimKey = makeIdempotencyClaimKey(input);
17001
17001
  await this.redis.releaseMollifierClaim(claimKey, `${PENDING_PREFIX}${input.token}`);
17002
17002
  }
17003
+ // Reopen a RESOLVED claim slot whose winner was cleared, so the claim-loser
17004
+ // reacquire path can re-serialise a cross-DB recreate through a fresh claim.
17005
+ // Compare-and-delete on the observed `expectedRunId` (never an unconditional
17006
+ // DEL) so a concurrent reacquirer that already re-published a NEW winner is
17007
+ // never wiped. Reuses the lookup self-heal's compare-and-delete Lua. Returns
17008
+ // true if the stale slot was cleared.
17009
+ async resetResolvedClaim(input) {
17010
+ const claimKey = makeIdempotencyClaimKey(input);
17011
+ const deleted = await this.redis.delMollifierKeyIfEquals(
17012
+ claimKey,
17013
+ input.expectedRunId
17014
+ );
17015
+ return deleted === 1;
17016
+ }
17003
17017
  // Read the current claim value, used by the wait/poll loop on losers
17004
17018
  // to detect "pending" → "resolved" transitions and timeouts.
17005
17019
  async readClaim(input) {