🤖 River for JavaScript and TypeScript 0.3.0.
Added
- Add optional
delete,deleteMany, anddeleteBeforepilot interceptors for job deletion through the client and job cleaner. Hooks run within the deletion transaction and can extend or replace the standard deletion. PR #1502. - Add
@riverqueue/driver-knexfor inserting jobs on Postgres inside Knex transactions, including batches, unique jobs, and nested savepoints. Configure itsknexTransactionAdapteronPgDriverto use native Knex transactions withcompleteTxin workers. PR #1516. - Support native Prisma interactive transactions with
completeTxin workers and{ tx }on Postgres client operations. ConfigureprismaTransactionAdapterfrom@riverqueue/driver-prismaonPgDriverto commit application writes and job completion together. PR #1517. - Support Node.js 24 across all packages. On runtimes without native
Temporal, preload an application-provided polyfill before importing River, including in worker threads. River validates runtime support on library import and never installs or replaces a global polyfill. The standaloneriverqueueCLI supplies its own polyfill when needed. Node.js 26 uses nativeTemporal. PR #1497, PR #1548.
Changed
- Breaking: Resumable steps can no longer be nested. Calls fail before running child callbacks, preventing unreachable resume points and rolled-back parent checkpoints from being saved again. PR #1534.
- Breaking: Like River for Go,
insertManyrejects an empty batch with aValidationErrorinstead of returning an empty result. PR #1504. - Like River for Go, the client no longer caps
maxAttemptsat 32767: SQLite stores wider attempt counts, and the Postgres and Prisma drivers clampmaxAttemptsto their 16-bit column on insert instead of failing. PR #1504. - Like River for Go's
ResumableStep, a failed resumable step records the step's own error as the attempt's error instead of wrapping it in aLifecycleError. PR #1504.
Fixed
- Refresh a durable periodic job's saved row only after its next run time is loaded at startup or committed. When a startup write rolled back, keep-alive could revive an expired row, and the next leader enqueued every run since the row's old next run time. PR #1540.
- Fail retries that omit a saved cursor-only step, while preserving their checkpoints for recovery. Jobs with an existing step marker retain their behavior, including legacy stale cursor entries. PR #1534.
- Replace whole top-level metadata values on SQLite, including JSON null, matching Postgres. Completed resumable cursor steps no longer run again because of stale cursor entries. PR #1533.
- Preserve first-step resumable cursors on failure and step progress on snooze. Transactional checkpoints no longer leak into deferred updates after rollback or a failed write; rolling back a successful checkpoint write may replay earlier unpersisted steps. PR #1521.
- Worker threads respect cancellation received while loading a handler module, before invoking its handler. PR #1497.
- Like River for Go, a leader whose renewal finds its term gone, because it expired or another process replaced it, gives up leadership at once instead of running maintenance until its local deadline passes. PR #1504.
updateQueueraising a full queue'smaxWorkersstarts jobs at once instead of waiting for a running job to finish. PR #1504.