Skip to content

12.35.1

Choose a tag to compare

@timgit timgit released this 30 Sep 19:16
· 292 commits to master since this release

Schema version: 43, unchanged from 12.35.0

  • Fix: with the Bun SQL adapter (fromBunSql), five statements bound a JSON payload that Bun encoded a second time. Postgres then received a JSON string instead of an object. Two of them failed silently:

    • findJobs() with a data filter returned no jobs.
    • redrive() and previewRedrive() with a data filter matched nothing, so they moved and counted nothing.

    The other three:

    • A schedule's lastJobId stayed null, and each cron pass that sent a job emitted a warning.
    • A schedule whose stored kind disagreed with its expression was not relabelled.
    • With persistWarnings on, a persisted warning's data was stored as a JSON string, not an object.

    Each statement now routes its payload through text, as #897 did for the ones that existed then. node-postgres and PGlite are unaffected.

    Thanks to @bbarks15 for reporting #936 and for #938.

  • Fix: on CockroachDB, a job whose data is an array could not fail. Failing it threw invalid input syntax for type json and left it active, whether it failed through fail(), a handler error, a per-job batch result, expiry or a missed heartbeat. Maintenance then hit the same error on every pass. Jobs with object data were not affected.

  • Fix: stop() no longer takes at least 500 ms when a worker has done any work. It now waits on the worker cleanups themselves, within the same deadline, instead of polling for them every 500 ms.

    Thanks to @bhamiltoncx for #935.

  • Fix: the JobAttempt type is now exported, for code that passes { id, retryCount } to the settle methods.

  • deleteAllJobs() now zeroes the cached queue counts when it truncates. With no name, and for a partitioned queue, it empties the table with TRUNCATE, and the counts that getQueue() returns now drop to zero at the same time instead of keeping the deleted jobs until the next monitor pass.

    Every other delete still leaves the counts to the next monitor pass. That covers deleteQueuedJobs(), deleteStoredJobs(), and deleteAllJobs(name) on a queue in the shared table. Recounting after a partial delete would mean an unbounded read of the job table, racing the monitor.

New Contributors

Full Changelog: 12.35.0...12.35.1