diff --git a/docs/plans/task-queue-execution.md b/docs/plans/task-queue-execution.md index 513db78..ced9f1a 100644 --- a/docs/plans/task-queue-execution.md +++ b/docs/plans/task-queue-execution.md @@ -101,3 +101,8 @@ ## 8. 交付节奏 - 代码 + 本地验证完成 → 通知用户,**不构建**;等用户确认后再 bump 版本、出测试包、发插件市场。 + +## 9. 实施状态(2026-12-03) + +- 已完成:宿主 `queue`/`pages` 能力、账本 meta/独立文件 `library/task-queue/index.json`、上限配置 `canvas.taskQueueMax`、左栏整页插件 `taskqueue 1.0.0`、下载落地/预览/定位/复制链接/清空/重试、真实应用页面与注入记录验证。 +- 待确认:bump 版本、出测试包、上传插件市场(taskqueue 1.0.0)。 diff --git a/src/image-ingest.js b/src/image-ingest.js index 0112c6d..4b6b0bd 100644 --- a/src/image-ingest.js +++ b/src/image-ingest.js @@ -150,7 +150,7 @@ const id = String(src.id || ('u_' + hash(url))) const exist = entries.get(id) if (exist) { - if (exist.status === STATE.FAILED) return retry(id) + if (exist.status === STATE.FAILED || exist.status === STATE.LINK_ONLY) return retry(id) return publicView(exist) } const e = { diff --git a/tests/image-ingest-test.js b/tests/image-ingest-test.js index b17f9b9..f7878b2 100644 --- a/tests/image-ingest-test.js +++ b/tests/image-ingest-test.js @@ -111,6 +111,10 @@ async function main () { const r = ingest.release(e.id) ok('⑥-1 变为 link-only', r.status === 'link-only') ok('⑥-2 引用被清空但 url 保留', r.ref === null && r.url === 'https://cdn/rel.png') + // 任务队列「下载」会再次 enqueue 同 url:link-only 必须回到 queued(否则永远不下) + const again = ingest.enqueue({ url: 'https://cdn/rel.png' }) + ok('⑥-3 link-only 再次 enqueue → queued', again && again.status === 'queued', again && again.status) + await until(() => ingest.get(e.id).status === 'ready', 2000) } // ⑦ 启动恢复:downloading/queued 重排,ready 保持