Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/mollifier-buffer-extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@trigger.dev/redis-worker": minor
"@trigger.dev/core": patch
---

Mollifier buffer feature set built on top of the initial primitives: idempotency-lookup with SETNX dedup, atomic snapshot-mutation API (`mutateSnapshot` with tag/metadata/delay/cancel patches), metadata CAS for lossless concurrent updates, watermark-paginated listing, claim primitives for pre-gate idempotency, ZSET-backed per-env queue, 30s post-ack grace TTL, and drop the accept-time entry TTL (drainer is now the only removal mechanism). `@trigger.dev/core` gains an optional `notice` field on the trigger response so the SDK can surface mollifier-queued guidance to customers.
1 change: 0 additions & 1 deletion apps/webapp/app/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,6 @@ const EnvironmentSchema = z
TRIGGER_MOLLIFIER_TRIP_THRESHOLD: z.coerce.number().int().positive().default(100),
TRIGGER_MOLLIFIER_HOLD_MS: z.coerce.number().int().positive().default(500),
TRIGGER_MOLLIFIER_DRAIN_CONCURRENCY: z.coerce.number().int().positive().default(50),
TRIGGER_MOLLIFIER_ENTRY_TTL_S: z.coerce.number().int().positive().default(600),
TRIGGER_MOLLIFIER_DRAIN_MAX_ATTEMPTS: z.coerce.number().int().positive().default(3),
TRIGGER_MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS: z.coerce.number().int().positive().default(30_000),
TRIGGER_MOLLIFIER_DRAIN_MAX_ORGS_PER_TICK: z.coerce.number().int().positive().default(500),
Expand Down
1 change: 0 additions & 1 deletion apps/webapp/app/v3/mollifier/mollifierBuffer.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function initializeMollifierBuffer(): MollifierBuffer {
enableAutoPipelining: true,
...(env.TRIGGER_MOLLIFIER_REDIS_TLS_DISABLED === "true" ? {} : { tls: {} }),
},
entryTtlSeconds: env.TRIGGER_MOLLIFIER_ENTRY_TTL_S,
});
}

Expand Down
16 changes: 16 additions & 0 deletions apps/webapp/app/v3/mollifier/mollifierSnapshot.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { serialiseSnapshot, deserialiseSnapshot } from "@trigger.dev/redis-worker";

// MollifierSnapshot is the JSON-serialisable shape of the input that would be
// passed to engine.trigger(). The drainer deserialises and replays it.
// Kept as Record<string, unknown> at this layer — the engine.trigger call site
// casts it to the engine's typed input. This keeps the mollifier subdirectory
// from depending on @internal/run-engine internals.
export type MollifierSnapshot = Record<string, unknown>;

export function serialiseMollifierSnapshot(input: MollifierSnapshot): string {
return serialiseSnapshot(input);
}

export function deserialiseMollifierSnapshot(serialised: string): MollifierSnapshot {
return deserialiseSnapshot<MollifierSnapshot>(serialised);
}
Loading