bunqueue 2.8.27 → 2.8.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,6 +105,12 @@ function getLockContext(ctx) {
105
105
  shardLocks: ctx.shardLocks,
106
106
  eventsManager: ctx.eventsManager,
107
107
  dashboardEmit: ctx.dashboardEmit,
108
+ // #110: without storage, handleMaxStallsExceeded's saveDlqEntry/deleteJob
109
+ // (the #97 fix) silently no-op via optional chaining on the ONLY
110
+ // production path to checkExpiredLocks — the DLQ move never persists and
111
+ // SQLite keeps an orphan `active` row. LockContext.storage is optional,
112
+ // which is why this omission compiled unnoticed since 2.8.17.
113
+ storage: ctx.storage,
108
114
  };
109
115
  }
110
116
  // ============ Job Timeouts ============
@@ -11,7 +11,7 @@ import type { SqliteStorage } from '../infrastructure/persistence/sqlite';
11
11
  export interface DlqContext {
12
12
  shards: Shard[];
13
13
  jobIndex: Map<JobId, JobLocation>;
14
- storage?: SqliteStorage | null;
14
+ storage: SqliteStorage | null;
15
15
  }
16
16
  /** Get jobs from DLQ (backward compatible) */
17
17
  export declare function getDlqJobs(queue: string, ctx: DlqContext, count?: number): Job[];
@@ -19,7 +19,7 @@ export interface QueueControlContext {
19
19
  completedJobsData?: MapLike<JobId, Job>;
20
20
  jobResults?: MapLike<JobId, unknown>;
21
21
  jobLogs?: MapLike<JobId, unknown>;
22
- storage?: SqliteStorage | null;
22
+ storage: SqliteStorage | null;
23
23
  }
24
24
  /** Pause a queue */
25
25
  export declare function pauseQueue(queue: string, ctx: QueueControlContext): void;
@@ -92,7 +92,7 @@ export interface LockContext {
92
92
  shardLocks: RWLock[];
93
93
  eventsManager: EventsManager;
94
94
  dashboardEmit?: (event: string, data: Record<string, unknown>) => void;
95
- storage?: SqliteStorage | null;
95
+ storage: SqliteStorage | null;
96
96
  }
97
97
  /** Context for background tasks */
98
98
  export interface BackgroundContext extends QueueManagerState {
@@ -19,6 +19,10 @@ export function getDlqContext(manager) {
19
19
  return {
20
20
  shards: getShards(manager),
21
21
  jobIndex: manager.getJobIndex(),
22
+ // #110-class: without storage, retryDlqByFilter's deleteDlqEntry/insertJob
23
+ // silently no-op — filtered retries were never persisted in embedded mode
24
+ // (dlq rows resurrected the jobs into the DLQ on restart).
25
+ storage: manager.storage,
22
26
  };
23
27
  }
24
28
  /** Convert client filter to domain filter */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunqueue",
3
- "version": "2.8.27",
3
+ "version": "2.8.28",
4
4
  "description": "High-performance job queue for Bun & AI agents. SQLite persistence, cron scheduling, priorities, retries, DLQ, webhooks, native MCP server. Zero external dependencies.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",