From d5d41309b7223a7521ac42ed69de711943ce285a Mon Sep 17 00:00:00 2001 From: Simon Cordt Date: Fri, 26 Sep 2025 18:09:11 +0200 Subject: [PATCH] Feat: Use database data for pending items --- web/js/pqueue.runtime.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/js/pqueue.runtime.js b/web/js/pqueue.runtime.js index 05a0f30..9cfa26b 100644 --- a/web/js/pqueue.runtime.js +++ b/web/js/pqueue.runtime.js @@ -26,6 +26,13 @@ state.error = null; const index = new Map(); + // Prefer db_by_id when available so running items also have DB info (renamed names) + if (queue?.db_by_id && typeof queue.db_by_id === 'object') { + Object.values(queue.db_by_id).forEach((row) => { + try { if (row?.prompt_id) index.set(String(row.prompt_id), row); } catch (err) { /* noop */ } + }); + } + // Always include db_pending as well state.db_pending.forEach((row) => { if (row?.prompt_id) index.set(String(row.prompt_id), row); });