Skip to content

12.38.2

Latest

Choose a tag to compare

@timgit timgit released this 10 Nov 21:36
· 29 commits to master since this release

Schema version: 46, unchanged from 12.38.0

  • Fix: a job waiting for its retry could be deleted before the retry ran. retentionSeconds counts from the time a job may start. A failure with retries left moved that time forward to the retry but kept the time the job was due to be deleted. A retry due after the job's first retention window ended was deleted by the next maintenance pass, with no event and no dead letter copy. A failure now moves the deletion time forward by the same amount. retry() and resume() move a job's start time up to now, and they now move its deletion time with it. A job retried or resumed after its first window ended is kept. Thanks to @calpeyser for the fix in #994.

  • Fix: in a session time zone with daylight saving time, a job whose start time moved across a DST change got a deletion time an hour off. That happened on a retry, retry(), resume() and an update() that changes startAfter. The deletion time is now exactly the job's retention window after its new start time. Sessions in UTC, or in any zone without DST, were not affected.

  • Fix: if registering the instance failed at start(), for example on a full connection pool, every later heartbeat failed with null value in column "started_on" of relation "instance" violates not-null constraint. The errors repeated every instanceHeartbeatSeconds until the instance stopped. A heartbeat now registers the instance again while no registration has succeeded, and that registration also counts crash restarts. Thanks to @simon-mx for the report and reproduction in #1004.

  • Fix: publish() with { db } looked up the subscribed queues on pg-boss's own pool instead of the db passed in. Inside a transaction, the lookup took a second pool connection while the transaction held its own. After stop(), publish() rejected even with a valid db. The lookup now runs on the db passed in, like the send() calls that follow it. Thanks to @Kalos-S for the fix in #1001.

  • Fix: the published CommandResponse type has had no fields since 12.0.0, because the build stripped all four. Code that reads affected from complete(), as the docs show, failed to compile. The declarations now include jobs, requested, affected and settled. Thanks to @Kalos-S for the fix in #998.

  • Fix: fail() typed data as object | null. Under strict, the error a catch block receives is unknown, and passing it to fail() failed to compile. data now accepts unknown. Thanks to @Kalos-S for the fix in #1000.

PRs

  • fix(pubsub): publish() looks up subscriptions on the db passed in options by @Kalos-S in #1001
  • fix(types): publish CommandResponse fields in the emitted declarations by @Kalos-S in #998
  • fix(types): fail() accepts a caught error of any type as data by @Kalos-S in #1000
  • fix(retry): a job waiting for its retry is not deleted by retention by @calpeyser in #994

Full Changelog: 12.38.1...12.38.2