github riverqueue/river js/v0.3.0

latest releases: java/v0.2.0, java/v0.1.0, rust/v0.4.0...
6 hours ago

🤖 River for JavaScript and TypeScript 0.3.0.

Added

  • Add optional delete, deleteMany, and deleteBefore pilot 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-knex for inserting jobs on Postgres inside Knex transactions, including batches, unique jobs, and nested savepoints. Configure its knexTransactionAdapter on PgDriver to use native Knex transactions with completeTx in workers. PR #1516.
  • Support native Prisma interactive transactions with completeTx in workers and { tx } on Postgres client operations. Configure prismaTransactionAdapter from @riverqueue/driver-prisma on PgDriver to 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 standalone riverqueue CLI supplies its own polyfill when needed. Node.js 26 uses native Temporal. 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, insertMany rejects an empty batch with a ValidationError instead of returning an empty result. PR #1504.
  • Like River for Go, the client no longer caps maxAttempts at 32767: SQLite stores wider attempt counts, and the Postgres and Prisma drivers clamp maxAttempts to 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 a LifecycleError. 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.
  • updateQueue raising a full queue's maxWorkers starts jobs at once instead of waiting for a running job to finish. PR #1504.

Don't miss a new river release

NewReleases is sending notifications on new releases.