bunqueue v2.8.25
Fixes 3 bugs. Fixed in src/client/queue/operations/query.ts for all three affected sites: getJobs (embedded), getJobsAsync (TCP), and getJob(id) over TCP, the last was the inverse of the same gap (its TCP branch patched only progress, so…
To install bunqueue v2.8.25
Section titled “To install bunqueue v2.8.25”bun add bunqueue@2.8.25npm install bunqueue@2.8.25To upgrade bunqueue
Section titled “To upgrade bunqueue”bun add bunqueue@latestBugfixes
Section titled “Bugfixes”queue.getJobs(), getJobsAsync(), and the getCompleted()/getFailed()/getWaiting()/getDelayed()/getActive() wrappers that delegate to them returned public job objects whose finishedOn and processedOn were always undefined, even for completed jobs, while the same job fetched via getJob(id) returned them correctly. Root cause: the list paths build jobs via createSimpleJob, which hardcodes finishedOn: undefined/processedOn: undefined, and never patched them from the internal job’s completedAt/startedAt (unlike progress/priority/attemptsMade). getJob(id) worked only because it routes through toPublicJob → buildJobProperties.
- Fixed in
src/client/queue/operations/query.tsfor all three affected sites:getJobs(embedded),getJobsAsync(TCP), andgetJob(id)over TCP, the last was the inverse of the same gap (its TCP branch patched onlyprogress, so post-fix it would have disagreed withgetJobs). All now mirrorbuildJobProperties: a numeric timestamp maps through,null→undefined(guarded bytypeof === 'number'). - The failure path is intentionally untouched: a failed job has no
completedAt(only the success path sets it;completedAtdoubles as a “completed” signal in cloud state classification andwaitUntilFinished), sofinishedOnstaysundefinedfor failed jobs in bothgetJobandgetJobs, consistent. A failed job’sprocessedOnis populated (it was started), matchinggetJob. - Tests:
test/repro-issue104-getjobs-finishedon.test.ts(6 embedded cases incl. parity withgetJob, a populated failed-jobprocessedOn, and a negative still-waiting case) and a new TCP integration case inscripts/tcp/test-query-operations.ts(“finishedOn/processedOn over TCP”) exercising the real wire path for bothgetJobsAsyncandgetJob(id).
Thanks to 1 contributor!
Section titled “Thanks to 1 contributor!”← bunqueue v2.8.24 · Release on GitHub · Commits since v2.8.24 · Full changelog · All posts