# bunqueue v2.6.5

Fixes 2 bugs. Typed event overloads for 'log' event on SandboxedWorker (on/once).

Canonical: https://bunqueue.dev/blog/bunqueue-v2-6-5/

---

<!-- Generated from changelog.md by docs/scripts/generate-release-posts.ts. Edit the changelog and regenerate. -->

Fixes 2 bugs. Typed event overloads for 'log' event on SandboxedWorker (on/once).

![](https://github.com/egeominotti.png?size=64) [egeominotti](https://github.com/egeominotti)

#### To install bunqueue v2.6.5

```bash title="bun"
bun add bunqueue@2.6.5
```

```bash title="npm"
npm install bunqueue@2.6.5
```

#### To upgrade bunqueue

```bash
bun add bunqueue@latest
```

## What's new

- Typed event overloads for `'log'` event on SandboxedWorker (`on`/`once`)
- Regression tests for both issues (`test/issue29-sandboxed-log.test.ts`, `test/issue30-dlq-stall.test.ts`)

## Bugfixes

- **SandboxedWorker `log` event not emitted**: The processor's `job.log()` method stored logs via `addLog()` but the SandboxedWorker never emitted a `'log'` event. Listeners registered with `.on('log', ...)` were never called. Now properly emits `(job, message)` on each log call. ([#29](https://github.com/egeominotti/bunqueue/issues/29))
- **SandboxedWorker embedded heartbeats missing**: In embedded mode, `sendHeartbeat` was a no-op and `heartbeatInterval` defaulted to 0 (timer never started). Long-running jobs without `progress()` calls were detected as stalled and moved to DLQ despite still running. Now `sendHeartbeat` calls `manager.jobHeartbeat()` and defaults to 5000ms. ([#30](https://github.com/egeominotti/bunqueue/issues/30))

## Documentation

- Updated SandboxedWorker processor example with `log()`, `fail()`, and `parentId` fields
- Fixed `heartbeatInterval` default from `0` to `5000` in embedded mode docs
- Added `log` event to SandboxedWorker Event Reference (8 events total)
- Added SandboxedWorker section to Stall Detection guide
- Updated SandboxedWorkerOptions type with `heartbeatInterval` and `connection` fields

## Thanks to 1 contributor!

- [@egeominotti](https://github.com/egeominotti)

---

[← bunqueue v2.6.4](https://bunqueue.dev/blog/bunqueue-v2-6-4/) · [Release on GitHub](https://github.com/egeominotti/bunqueue/releases/tag/v2.6.5) · [Commits since v2.6.4](https://github.com/egeominotti/bunqueue/compare/v2.6.4...v2.6.5) · [Full changelog](https://bunqueue.dev/changelog/) · [All posts](https://bunqueue.dev/blog/)
