From 739038c299c0b3d3aa70d78b46d12f59feb8d82d Mon Sep 17 00:00:00 2001 From: Ultroncn <82553854+Ultroncn@users.noreply.github.com> Date: Mon, 30 Nov 2026 14:41:57 +0800 Subject: [PATCH] fix(archive): skip missing session logs and clear stale entries --- CHANGELOG.md | 12 ++++ README.en.md | 2 +- README.md | 2 +- docs/ARCHITECTURE.en.md | 3 +- docs/ARCHITECTURE.md | 3 +- docs/USER_GUIDE.md | 4 +- docs/USER_GUIDE.zh-CN.md | 4 +- docs/images/remove-missing-chat-entries.png | Bin 0 -> 17238 bytes lib/client.js | 54 +++++++++++++-- lib/index.js | 71 ++++++++++++++++++-- lib/persistence-compat.js | 11 +++ lib/types/index.d.ts | 2 +- package-lock.json | 4 +- package.json | 2 +- test/archive-lifecycle.test.mjs | 68 +++++++++++++++++++ test/package.test.mjs | 1 + test/smoke.test.mjs | 4 +- 17 files changed, 224 insertions(+), 23 deletions(-) create mode 100644 docs/images/remove-missing-chat-entries.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bf3a51..ddae46f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ Entries describe behavior at each release, not necessarily current behavior. Consult the READMEs and user guides for current usage. +## 2.0.9 — 2026-11-30 + +### 中文 + +- 修复归档列表每次刷新时逐个读取缺失会话日志的问题。缺失条目仍可见;已有会话的标题最多同时读取 8 个。 +- 在已归档的操作菜单中新增「移除缺失会话的归档标记」。确认后逐条复查,只移除宿主明确报告会话不存在的标记。会话文件、标签和备注均保留。 + +### English + +- Fix slow archive loading when the registry still contains missing chats. Refreshes skip title reads for missing sessions and read up to eight other titles at a time. +- Add **Remove missing chat entries** to the Archived actions menu. After confirmation, each entry is checked again. Only archive markers for sessions the Host explicitly reports as missing are removed. Session files, tags and notes are preserved. + ## 2.0.8 — 2026-11-27 ### 中文 diff --git a/README.en.md b/README.en.md index 9a5f41a..46064cc 100644 --- a/README.en.md +++ b/README.en.md @@ -34,7 +34,7 @@ Archive Management adds conversation search, organization and backups to DeepSee - **Portable backups:** export and import JSON + Markdown ZIPs; imports preview before writing and skip existing IDs to avoid overwrites. - **Conversation lineage:** read-only Origins & Branches view traces sources, forks and subagent relationships across all workspaces, including archived and unarchived chats. -> This document describes version 2.0.8. Previous recovery features are removed, with explicit retries for permanent-deletion tasks. +> This document describes version 2.0.9. Previous recovery features are removed, with explicit retries for permanent-deletion tasks. ## Install and open diff --git a/README.md b/README.md index 1858a67..09208fc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ - **可迁移备份:** 导出和导入 JSON + Markdown ZIP;导入前预览,跳过已有 ID,不覆盖现有数据。 - **会话溯源:** 只读的「来源与分支」视图查看所有工作区中已归档、未归档会话的来源、分叉和子代理关系。 -> 本文描述 2.0.8,旧恢复功能已移除,永久删除支持任务重试。 +> 本文描述 2.0.9,旧恢复功能已移除,永久删除支持任务重试。 diff --git a/docs/ARCHITECTURE.en.md b/docs/ARCHITECTURE.en.md index 407fecb..ac8e6bd 100644 --- a/docs/ARCHITECTURE.en.md +++ b/docs/ARCHITECTURE.en.md @@ -2,7 +2,7 @@ English · [中文](ARCHITECTURE.md) · [User guide](USER_GUIDE.md) -This document describes the interfaces and behavior of version 2.0.8. Native integration tests cover DSH `0.1.7-rc.2`, `0.2.1-rc.2`, `0.2.1-rc.5`, `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.5` and `0.2.3-alpha.2`. See the [changelog](../CHANGELOG.md) for release history. Runtime code is the authority for interfaces and behavior; user-facing documentation should agree with it. +This document describes the interfaces and behavior of version 2.0.9. Native integration tests cover DSH `0.1.7-rc.2`, `0.2.1-rc.2`, `0.2.1-rc.5`, `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.5` and `0.2.3-alpha.2`. See the [changelog](../CHANGELOG.md) for release history. Runtime code is the authority for interfaces and behavior; user-facing documentation should agree with it. The default JSONL backend covers archive/unarchive, ZIP export/restore, permanent deletion and failure rollback. `0.2.3-alpha.2` requires Node.js `^24.22.3 || >=26.13.1`. The optional SQLite backend is tested for inventory, preview, archive/unarchive and ZIP export. The Host has no rollback-safe import or per-session deletion API for this shared store, so the plugin refuses ZIP restore and permanent deletion while preserving existing data and backups. Native tests use real persistence components with simulated workspace/routes. Published client packages for `rc.5` and `alpha.2` also have four mandatory contract checks each in Ubuntu CI, covering module loading, control rendering, settings registration and disposal. These checks omit CSS/layout and are not a full Web UI acceptance test. @@ -55,6 +55,7 @@ POST /plugins/dsh-archived-chats/deletion/preview POST /plugins/dsh-archived-chats/deletion/execute POST /plugins/dsh-archived-chats/unarchive POST /plugins/dsh-archived-chats/unarchive-all +POST /plugins/dsh-archived-chats/forget-missing POST /plugins/dsh-archived-chats/delete POST /plugins/dsh-archived-chats/delete-all GET /plugins/dsh-archived-chats/unarchived diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 3bad457..3a57311 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -2,7 +2,7 @@ [English](ARCHITECTURE.en.md) · 中文 · [用户指南](USER_GUIDE.zh-CN.md) -本文描述 2.0.8 的接口与行为;原生集成测试覆盖 DSH `0.1.7-rc.2`、`0.2.1-rc.2`、`0.2.1-rc.5`、`0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.5` 和 `0.2.3-alpha.2`。版本变更见[更新日志](../CHANGELOG.md)。运行时代码是接口与行为的依据;用户操作说明与本文应保持一致。 +本文描述 2.0.9 的接口与行为;原生集成测试覆盖 DSH `0.1.7-rc.2`、`0.2.1-rc.2`、`0.2.1-rc.5`、`0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.5` 和 `0.2.3-alpha.2`。版本变更见[更新日志](../CHANGELOG.md)。运行时代码是接口与行为的依据;用户操作说明与本文应保持一致。 默认 JSONL 后端覆盖归档、取消归档、ZIP 导出与恢复,以及永久删除和失败回滚。`0.2.3-alpha.2` 需要 Node.js `^24.22.3 || >=26.13.1`。可选 SQLite 后端已验证列表、预览、归档/取消归档和 ZIP 导出;宿主尚未提供可安全回滚的导入或单会话删除接口,插件会拒绝 ZIP 恢复和永久删除,保留现有数据与备份。原生测试使用真实持久化组件和模拟的工作区/路由。`rc.5` 和 `alpha.2` 另用已发布的客户端组件执行模块加载、控件渲染、设置注册和卸载契约测试,每套 4 项,在 Ubuntu CI 强制执行;样式与布局不在这些测试范围内,不等同于完整 Web 界面验收。 @@ -55,6 +55,7 @@ POST /plugins/dsh-archived-chats/deletion/preview POST /plugins/dsh-archived-chats/deletion/execute POST /plugins/dsh-archived-chats/unarchive POST /plugins/dsh-archived-chats/unarchive-all +POST /plugins/dsh-archived-chats/forget-missing POST /plugins/dsh-archived-chats/delete POST /plugins/dsh-archived-chats/delete-all GET /plugins/dsh-archived-chats/unarchived diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.md index 21f95a4..e5f4730 100644 --- a/docs/USER_GUIDE.md +++ b/docs/USER_GUIDE.md @@ -4,7 +4,7 @@ Current source removes the previous recovery UI and keeps explicit permanent-del English · [简体中文](USER_GUIDE.zh-CN.md) · [Back to README](../README.en.md) -Archive Management provides a place to browse and manage DSH's archived chats, plus workspace bulk archiving. This document describes version 2.0.8, with native integration coverage for DSH `0.1.7-rc.2`, `0.2.1-rc.2`, `0.2.1-rc.5`, `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.5` and `0.2.3-alpha.2`. See the [changelog](../CHANGELOG.md) for release history. For interfaces and data formats, see the [architecture](ARCHITECTURE.en.md). +Archive Management provides a place to browse and manage DSH's archived chats, plus workspace bulk archiving. This document describes version 2.0.9, with native integration coverage for DSH `0.1.7-rc.2`, `0.2.1-rc.2`, `0.2.1-rc.5`, `0.2.2-rc.1`, `0.2.2-rc.2`, `0.2.2-rc.3`, `0.2.2-rc.5` and `0.2.3-alpha.2`. See the [changelog](../CHANGELOG.md) for release history. For interfaces and data formats, see the [architecture](ARCHITECTURE.en.md). The interface has four tabs, Archived, Unarchived, Origins & Branches, and About. @@ -14,6 +14,8 @@ Archive Management prefers the Host’s public Modal, Button, Input, menu, Toolt ## Chat states and legacy data +When an archived chat is missing from storage, its row stays visible as **Session unavailable**. From the Archived actions menu, choose **Remove missing chat entries** and confirm. The plugin checks each entry again and clears only its archive marker when the Host explicitly confirms absence. Files, tags and notes are preserved. Hosts without this check do not offer the action. + | Location | Purpose | Return to the main chat area | | --- | --- | --- | | Main chat area | Continue everyday conversations | Already there | diff --git a/docs/USER_GUIDE.zh-CN.md b/docs/USER_GUIDE.zh-CN.md index fb2e460..ca18568 100644 --- a/docs/USER_GUIDE.zh-CN.md +++ b/docs/USER_GUIDE.zh-CN.md @@ -2,7 +2,7 @@ [English](USER_GUIDE.md) · 简体中文 · [返回 README](../README.md) -归档管理为 DSH 已归档聊天提供查看和管理页面,并扩展按工作区批量归档。本文描述 2.0.8 的行为(包含未归档正文搜索),原生集成测试覆盖 DSH `0.1.7-rc.2`、`0.2.1-rc.2`、`0.2.1-rc.5`、`0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.5` 和 `0.2.3-alpha.2`。版本变更见[更新日志](../CHANGELOG.md),接口和数据格式见[架构说明](ARCHITECTURE.md)。 +归档管理为 DSH 已归档聊天提供查看和管理页面,并扩展按工作区批量归档。本文描述 2.0.9 的行为(包含未归档正文搜索),原生集成测试覆盖 DSH `0.1.7-rc.2`、`0.2.1-rc.2`、`0.2.1-rc.5`、`0.2.2-rc.1`、`0.2.2-rc.2`、`0.2.2-rc.3`、`0.2.2-rc.5` 和 `0.2.3-alpha.2`。版本变更见[更新日志](../CHANGELOG.md),接口和数据格式见[架构说明](ARCHITECTURE.md)。 界面固定为已归档、未归档、来源与分支、关于四个标签。 @@ -12,6 +12,8 @@ ## 会话状态与旧数据 +宿主找不到已归档会话时,列表仍保留「会话不可用」这一行。在已归档的操作菜单选择「移除缺失会话的归档标记」并确认,插件会逐条重新核对,只移除宿主明确确认缺失的归档标记,保留会话文件、标签和备注。宿主不支持核对时不会提供这个操作。 + | 位置 | 用途 | 如何返回主页面 | | --- | --- | --- | | 主页面会话区 | 日常继续聊天 | 已在主页面 | diff --git a/docs/images/remove-missing-chat-entries.png b/docs/images/remove-missing-chat-entries.png new file mode 100644 index 0000000000000000000000000000000000000000..e08087b777bc7e219d9022a9701ed4e8b88d59aa GIT binary patch literal 17238 zcmc({RZtvp)F+C&1$RgY?jg8K(BSUw?(P;Gf(Ca8?(XjH&fxBDxAVzv?Ze$$xAtLQ zx|m|7y8CqZ>GQLHn4F9lG6FsV7#J9`gt&+T7#O%0@b?rP1h9>ulWqe8Lj#i#5ma(Z zKh1y__^C}W$e4R-Osh_l8!Sm*((_==agz68%`x+aXY$WP9yT%Yg#B8nYNcc%O@G+q!=^7Z z>def{rEQK-@TIbpl$56C%Xk_)op8OyJVyZOyAwJ(`XwXG`=8o_Q!C5ArKLsr`Cln0 zKmx+TkVV(K!@Ulmt-i4M7Zj*UwT7V1*Y(y1UeCK>vd>N_UY~H-V_9uCJLc!+%H;Dz zmurkU14w^;pkrVJ`jYUt$+fxJpLgbpy`DUX*yr3-!np*55gf9Lii&=^5+@Oy zCS!2zK+JHx*ubJwW76&LqQgRmU5WDd2d^WDCWZS#dzmXHckYG5g~p7=Wnp2FE)LqN ztFC6I=7173N~@}3qWHO_s&l@(C!zo&lP#OYx6Q%I%F4^zZof0|)gCV35sy?v+uo)+y?$lrZ zU$-@5Pd7LNkwhQQcLWS4JihNl$yN5VCKt<&oFGPlKSHLr zDfX%4BbOvnr5bOrNFGnuSP!Pv9|D&ves}D)8@n|!Mn<3rTHiZp+cnmxu>usVF`Kx9{l?wPSEQHtt9e>!LVr{L8Z^|!j-$?NKX8a$k? zyMDYw8j|H1ilJiBYb3lVJ|1NG67zVe^-sl)VmI1s4%EBf>^DUpoz9Ta(a}+FQz!p$ za-v;XQiHwN?4^$RIqLOte>NCH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e>bpD!)&k6F~9X@;>jcoO7RnpM7Zs;#dNam{f9L5j$-`PYkY0pCCt2 z5Oral%?>6q@~_dL;*d$X{+U#nd!P_0DU7~F_xALt@$GhXe!Rah2FX}h&=B&+DsWV2 zH9L%_vi@69V9YPTac3Y3nD@Rxi)n!DKtiFx!H=p?h-vW6ie+ld_gJ~GrV`I+P@j># zzD)xiV57}{YU_;JKCCya+5S2xH1tN^tZxq`of}{Sj*1|Xd literal 0 HcmV?d00001 diff --git a/lib/client.js b/lib/client.js index 5431b9b..b1dbeb0 100644 --- a/lib/client.js +++ b/lib/client.js @@ -315,6 +315,10 @@ window.__ModuleLoader__.load({ "sort.title": "按标题", "group.noProject": "未分组", "group.defaultWorkspace": "默认工作区", + "chat.unavailable": "会话不可用", + "archive.forgetMissing": "移除缺失会话的归档标记", + "archive.forgetBody": "将重新检查 {count} 条记录,只移除宿主确认缺失的归档标记。会话文件、标签和备注会保留。", + "archive.forgetResult": "已移除 {removed} 条标记,保留 {kept} 条。", "chat.untitled": "未命名会话", "chat.unarchive": "取消归档", "unarchive.cwdMissing": "此聊天没有工作目录,当前宿主无法将它放回主聊天列表。已归档副本仍保留,可继续预览或导出。", @@ -747,6 +751,10 @@ window.__ModuleLoader__.load({ "sort.title": "Title", "group.noProject": "Ungrouped", "group.defaultWorkspace": "Default workspace", + "chat.unavailable": "Session unavailable", + "archive.forgetMissing": "Remove missing chat entries", + "archive.forgetBody": "Recheck {count} entries and remove archive markers for chats the Host confirms are missing. Session files, tags and notes are kept.", + "archive.forgetResult": "Removed {removed} entries. Kept {kept}.", "chat.untitled": "Untitled chat", "chat.unarchive": "Unarchive", "unarchive.cwdMissing": "This chat has no working directory, so this Host cannot return it to the main chat list. Its archived copy is preserved for preview and export.", @@ -1178,6 +1186,10 @@ window.__ModuleLoader__.load({ "sort.title": "Titel", "group.noProject": "Ohne Gruppe", "group.defaultWorkspace": "Standardarbeitsbereich", + "chat.unavailable": "Chat nicht verfügbar", + "archive.forgetMissing": "Fehlende Archiveinträge entfernen", + "archive.forgetBody": "{count} Einträge erneut prüfen und nur bestätigte fehlende Chats aus dem Archiv austragen. Dateien, Tags und Notizen bleiben erhalten.", + "archive.forgetResult": "{removed} Einträge entfernt, {kept} beibehalten.", "chat.untitled": "Chat ohne Titel", "chat.unarchive": "Archivierung aufheben", "unarchive.cwdMissing": "Dieser Chat hat kein Arbeitsverzeichnis. Der Host kann ihn daher nicht wieder in die Hauptliste aufnehmen. Die archivierte Kopie bleibt für Vorschau und Export erhalten.", @@ -1608,6 +1620,10 @@ window.__ModuleLoader__.load({ "sort.title": "Título", "group.noProject": "Sin agrupar", "group.defaultWorkspace": "Espacio de trabajo predeterminado", + "chat.unavailable": "Chat no disponible", + "archive.forgetMissing": "Quitar entradas de chats ausentes", + "archive.forgetBody": "Se revisarán {count} entradas. Solo se quitarán las marcas de archivo de chats cuya ausencia confirme el sistema. Se conservarán los archivos, etiquetas y notas.", + "archive.forgetResult": "Se quitaron {removed} entradas y se conservaron {kept}.", "chat.untitled": "Chat sin título", "chat.unarchive": "Desarchivar", "unarchive.cwdMissing": "Este chat no tiene un directorio de trabajo, así que este Host no puede devolverlo a la lista principal. Se conserva la copia archivada para que puedas consultarla y exportarla.", @@ -2038,6 +2054,10 @@ window.__ModuleLoader__.load({ "sort.title": "Titre", "group.noProject": "Sans groupe", "group.defaultWorkspace": "Espace de travail par défaut", + "chat.unavailable": "Conversation indisponible", + "archive.forgetMissing": "Retirer les entrées manquantes", + "archive.forgetBody": "Vérifier {count} entrées et retirer les marqueurs d’archive des conversations dont l’hôte confirme l’absence. Les fichiers, étiquettes et notes sont conservés.", + "archive.forgetResult": "{removed} entrées retirées, {kept} conservées.", "chat.untitled": "Conversation sans titre", "chat.unarchive": "Désarchiver", "unarchive.cwdMissing": "Cette conversation n’a pas de répertoire de travail. DSH Host ne peut donc pas la remettre dans la liste principale. Sa copie archivée est conservée : vous pouvez toujours la consulter ou l’exporter.", @@ -2468,6 +2488,10 @@ window.__ModuleLoader__.load({ "sort.title": "タイトル順", "group.noProject": "グループなし", "group.defaultWorkspace": "既定のワークスペース", + "chat.unavailable": "チャットを利用できません", + "archive.forgetMissing": "見つからないチャットのアーカイブ記録を解除", + "archive.forgetBody": "{count} 件を再確認し、ホストが存在しないと確認したチャットのアーカイブ記録を解除します。ファイル、タグ、メモは保持されます。", + "archive.forgetResult": "{removed} 件を解除し、{kept} 件を保持しました。", "chat.untitled": "無題のチャット", "chat.unarchive": "アーカイブを解除", "unarchive.cwdMissing": "このチャットには作業ディレクトリがないため、この Host ではメインのチャット一覧に戻せません。アーカイブ済みのコピーは保持されており、引き続きプレビューやエクスポートができます。", @@ -2898,6 +2922,10 @@ window.__ModuleLoader__.load({ "sort.title": "Título", "group.noProject": "Sem grupo", "group.defaultWorkspace": "Espaço de trabalho padrão", + "chat.unavailable": "Conversa indisponível", + "archive.forgetMissing": "Remover entradas de conversas ausentes", + "archive.forgetBody": "Verificar {count} entradas e remover as marcas de arquivo de conversas cuja ausência o sistema confirmar. Arquivos, etiquetas e notas serão preservados.", + "archive.forgetResult": "{removed} entradas removidas e {kept} mantidas.", "chat.untitled": "Conversa sem título", "chat.unarchive": "Desarquivar", "unarchive.cwdMissing": "Esta conversa não tem um diretório de trabalho, por isso este Host não pode colocá-la de volta na lista principal. A cópia arquivada foi preservada e continua disponível para prévia e exportação.", @@ -3328,6 +3356,10 @@ window.__ModuleLoader__.load({ "sort.title": "По названию", "group.noProject": "Без группы", "group.defaultWorkspace": "Рабочее пространство по умолчанию", + "chat.unavailable": "Чат недоступен", + "archive.forgetMissing": "Убрать записи отсутствующих чатов", + "archive.forgetBody": "Проверить записи ({count}) и убрать отметки архива только у чатов, отсутствие которых подтвердит система. Файлы, метки и заметки сохранятся.", + "archive.forgetResult": "Убрано записей: {removed}. Сохранено: {kept}.", "chat.untitled": "Чат без названия", "chat.unarchive": "Вернуть из архива", "unarchive.cwdMissing": "У чата нет рабочей папки, поэтому Host не может вернуть его в основной список. Архивная копия сохранена и доступна для просмотра и экспорта.", @@ -3627,6 +3659,10 @@ window.__ModuleLoader__.load({ function archiveActionConfirmation(t, action, ids, sessions, scope = { kind: "chat" }) { const selected = sessions.filter((row) => ids.includes(row.id)); const count = ids.length; + if (action === "forget-missing") return { + title: t("archive.forgetMissing"), body: t("archive.forgetBody", { count }), + label: t("archive.forgetMissing"), danger: false, + }; const workspace = scope.kind === "workspace"; const all = scope.kind === "all"; const selection = scope.kind === "selection"; @@ -7021,9 +7057,9 @@ window.__ModuleLoader__.load({ className: "dac-row-main", children: [ (0, jsx.jsx)(PreviewTitleButton, { - sessionId: session.id, title: session.title ?? t("chat.untitled"), - label: previewOpenLabel(t, session.title ?? t("chat.untitled")), - disabled: busy[session.id] === true, + sessionId: session.id, title: session.headerMissing ? t("chat.unavailable") + " · " + session.id : session.title ?? t("chat.untitled"), + label: session.headerMissing ? t("chat.unavailable") + " · " + session.id : previewOpenLabel(t, session.title ?? t("chat.untitled")), + disabled: session.headerMissing || busy[session.id] === true, onPreview: () => onPreview(session, onArchive ? "unarchived" : "archive") }), (0, jsx.jsxs)("div", { @@ -8358,7 +8394,15 @@ window.__ModuleLoader__.load({ try { if (confirm.action === "export") await exportSessions(confirm.ids); else if (confirm.action === "unarchive") { await unarchive(confirm.ids); refreshSidebar?.(); } - else if (confirm.action === "permanent") await runPermanentDelete(confirm.ids, confirm.preview); + else if (confirm.action === "forget-missing") { + try { + const result = await post("/forget-missing", { sessionIds: confirm.ids }); + setNotice({ kind: result.kept.length ? "error" : "ok", text: t("archive.forgetResult", { removed: result.removed.length, kept: result.kept.length }) }); + } finally { + await refresh(); + } + } + else if (confirm.action === "permanent") await runPermanentDelete(confirm.ids, confirm.preview); } catch (error) { setNotice({ kind: "error", text: String(error.message ?? error) }); } finally { @@ -8639,6 +8683,7 @@ window.__ModuleLoader__.load({ } const allIds = (sessions ?? []).map((s) => s.id); + const missingIds = (sessions ?? []).filter(s => s.canForget).map(s => s.id); const visibleIds = groups.flatMap(group => group.items.map(row => row.id)); const selectableIds = visibleIds.filter(id => busy[id] !== true); const selected = allIds.filter(id => selectedIds.has(id)); @@ -8698,6 +8743,7 @@ window.__ModuleLoader__.load({ (0, jsx.jsx)("div", { className: "dac-menu-heading", role: "presentation", children: t("menu.allWorkspaces") }), (0, jsx.jsx)(HostMenuItem, { type: "button", className: "dac-menu-item", disabled: importBusy, onClick: () => { importReturnFocusRef.current = document.activeElement; importInputRef.current?.click?.(); }, children: t("action.import") }), (0, jsx.jsx)(HostMenuItem, { type: "button", className: "dac-menu-item", disabled: allIds.length === 0 || allBusy, onClick: () => askArchiveAction("export", allIds, { kind: "all" }), children: t("action.export") }), + missingIds.length > 0 && (0, jsx.jsx)(HostMenuItem, { type: "button", className: "dac-menu-item", disabled: allBusy, onClick: () => askArchiveAction("forget-missing", missingIds, { kind: "all" }), children: t("archive.forgetMissing") }), (0, jsx.jsx)(HostMenuItem, { type: "button", className: "dac-menu-item", disabled: allIds.length === 0 || allBusy, onClick: () => askArchiveAction("unarchive", allIds, { kind: "all" }), children: t("menu.unarchiveAll") }), (0, jsx.jsx)("div", { role: "separator", className: "dac-menu-separator" }), (0, jsx.jsx)(HostMenuItem, { type: "button", className: "dac-menu-item dac-danger", disabled: allIds.length === 0 || allBusy, onClick: () => askPermanentDelete(allIds, { kind: "all" }), children: t("menu.deleteAllPermanently") }), diff --git a/lib/index.js b/lib/index.js index 361fc9d..8581b2f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -532,21 +532,26 @@ async function listArchived(ctx, registry, persistence, titleCache, metadataStor return { metadataStatus: metadata.status, deletionStatus: tasks.status, sessions: [] }; } const headerById = new Map(); + let inventoryReady = false; try { for (const header of await persistence.list()) headerById.set(String(header.id), header); + inventoryReady = true; } catch (error) { ctx.logger.warn(`archived-chats: session header listing failed: ${String(error)}`); } const live = ctx.get('sessions'); const workspaces = registry.list(); - const rows = []; - for (const id of archivedIds) { + const canForget = typeof live?.get === 'function' && typeof persistence.confirmMissing === 'function' + && typeof registry.unarchiveSession === 'function'; + async function readRow(id) { // Scoped previews and search batches must not read unrelated or hidden // logs even for title metadata. List consumers retain their full scope. - if (candidateIds !== undefined && !(await isVisibleArchivedSession(registry, pendingStore, deletionStore, id))) continue; - const header = headerById.get(id) ?? live?.get(id)?.header; + if (candidateIds !== undefined && !(await isVisibleArchivedSession(registry, pendingStore, deletionStore, id))) return null; + const liveSession = live?.get(id); + const header = headerById.get(id) ?? liveSession?.header; + const missing = inventoryReady && !header && !liveSession; let title = titleCache?.get(id); - if (title === undefined) { + if (!missing && title === undefined) { try { title = typeof persistence.readTitle === 'function' ? await persistence.readTitle(id) @@ -560,8 +565,9 @@ async function listArchived(ctx, registry, persistence, titleCache, metadataStor } } const workspace = workspaces.find((item) => workspaceSessionIds(item).includes(id)); - rows.push({ + return { id, + ...(missing ? { headerMissing: true, canForget } : {}), title: title ?? null, createdAt: header?.createdAt ?? null, updatedAt: sessionListUpdatedAt(ctx, id, header), @@ -569,7 +575,12 @@ async function listArchived(ctx, registry, persistence, titleCache, metadataStor workspaceId: workspace === undefined ? null : String(workspace.id), workspaceTitle: workspace?.title ?? null, workspacePath: workspace?.path ?? null, - }); + }; + } + const rows = []; + for (let offset = 0; offset < archivedIds.length; offset += 8) { + const batch = await Promise.all(archivedIds.slice(offset, offset + 8).map(readRow)); + rows.push(...batch.filter(Boolean)); } // Parked-for-deletion sessions stay archived (invisible everywhere) but are // excluded from the listing: they have been accepted for deletion and only @@ -1711,6 +1722,52 @@ function registerRoutes(ctx, webServer, registry, persistence, titleCache, metad }, }), 'archived-chats: unarchive-all route'); + ctx.effect(() => webServer.register({ + kind: 'exact', + path: `${ROUTE_PREFIX}/forget-missing`, + handler: async (req, res) => { + if (!guard(req, res)) return; + try { + const body = await readBody(req); + if (!Array.isArray(body?.sessionIds) || !body.sessionIds.length + || body.sessionIds.some(id => typeof id !== 'string' || !id.trim())) { + send(res, 400, { error: 'sessionIds-required' }); return; + } + const result = await lifecycle.run(async () => { + const live = ctx.get('sessions'); + if (typeof persistence.confirmMissing !== 'function' || typeof live?.get !== 'function' + || typeof registry.unarchiveSession !== 'function') { + throw reachabilityError('missing-check-unsupported', 501, 'missing-check-unsupported', [], 'Host cannot confirm missing sessions'); + } + const tasks = await deletionStore.load(); + if (tasks.status !== 'ready') throw reachabilityError('deletion-tasks-unavailable', 503, 'deletion-tasks-unavailable', [], 'deletion tasks unavailable'); + const ids = [...new Set(body.sessionIds)]; + await requireNoPendingDeletion(pendingStore, ids); + const headers = await persistence.list(); + const present = new Set(headers.map(header => header.id)); + const removed = []; + const kept = []; + for (const id of ids) { + if (!registry.archivedSessionIds.includes(id)) continue; + if (tasks.records.has(id) || present.has(id) || live.get(id) + || !await persistence.confirmMissing(id) || live.get(id)) { + kept.push(id); + continue; + } + // Only release the archive marker through the Host. No file or metadata deletion. + await registry.unarchiveSession(id); + invalidateSessionCaches([id]); + removed.push(id); + } + return { removed, kept }; + }); + send(res, 200, result); + } catch (error) { + send(res, error.status ?? 503, { error: error.code ?? 'missing-check-unavailable' }); + } + }, + }), 'archived-chats: forget missing archive entries'); + const unifiedDeletionHandler = execute => async (req, res) => { if (!guard(req, res)) return; try { diff --git a/lib/persistence-compat.js b/lib/persistence-compat.js index 18c0421..1bfd65d 100644 --- a/lib/persistence-compat.js +++ b/lib/persistence-compat.js @@ -163,6 +163,17 @@ export function resolvePersistenceCompat(raw) { return (await listSnapshots()).map((snapshot) => snapshot.header); }, listSnapshots, + async confirmMissing(id) { + let handle; + try { + handle = await raw.open.call(raw, id, 'read'); + } catch (error) { + // A damaged log, denied access or a backend outage is not proof of absence. + return error?.name === 'SessionPersistenceNotFoundError' && error.sessionId === id; + } + await handle.close(); + return false; + }, async inspect(id) { return inspect(id); }, diff --git a/lib/types/index.d.ts b/lib/types/index.d.ts index dc49c60..9b8f2dd 100644 --- a/lib/types/index.d.ts +++ b/lib/types/index.d.ts @@ -8,7 +8,7 @@ * preview, preview/image, search, * export, import/inspect, import/restore, * metadata, unarchive, - * unarchive-all, delete, delete-all), streams + * unarchive-all, forget-missing, delete, delete-all), streams * JSON/Markdown backup ZIPs, and wires archive information: * per-session tags/notes joined into `/state`, storage statistics from * `/stats`, guarded projected-message reads through `/preview` and `/search`. diff --git a/package-lock.json b/package-lock.json index 7be0396..ecd5166 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dsh-archived-chats", - "version": "2.0.8", + "version": "2.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dsh-archived-chats", - "version": "2.0.8", + "version": "2.0.9", "license": "MIT", "dependencies": { "fflate": "^0.8.3" diff --git a/package.json b/package.json index ab33c3e..7553d86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsh-archived-chats", - "version": "2.0.8", + "version": "2.0.9", "description": "查看、搜索和管理会话归档,支持工作区批量归档、标签备注、ZIP 备份和会话谱系。", "license": "MIT", "author": "Ultroncn", diff --git a/test/archive-lifecycle.test.mjs b/test/archive-lifecycle.test.mjs index e9399bb..68733ec 100644 --- a/test/archive-lifecycle.test.mjs +++ b/test/archive-lifecycle.test.mjs @@ -1082,3 +1082,71 @@ test('legacy recovery and retention routes are removed while task retries remain assert.equal(response.status, 409); assert.equal(await exists(f.path), true); }); + +test('archive refresh skips missing logs, retries after reappearance and keeps live sessions visible', async t => { + const f = await fixture(t, { modern: true }); + const existing = (await f.persistence.list())[0]; + let restored = false; + f.registry.state.archivedSessionIds = ['chat-a', 'missing', 'live']; + f.persistence.list = async () => [existing, ...(restored ? [{ ...existing, header: { ...existing.header, id: 'missing' } }] : [])]; + f.services.sessions.get = id => id === 'live' ? { header: { ...existing.header, id } } : undefined; + const opened = []; + const open = f.persistence.open; + f.persistence.open = async id => { + opened.push(id); + const handle = await open(); + return { ...handle, header: { ...handle.header, id } }; + }; + for (let i = 0; i < 2; i++) { + const { status, body } = await f.call('/state'); + assert.equal(status, 200); + assert.deepEqual(body.sessions.map(row => row.id), ['chat-a', 'missing', 'live']); + assert.equal(body.sessions[1].headerMissing, true); + assert.equal(body.sessions[1].canForget, true); + assert.ok(body.sessions[2].title); + } + assert.deepEqual(opened.sort(), ['chat-a', 'live']); + restored = true; + const normal = (await f.call('/state')).body.sessions[1]; + assert.ok(normal.title); + assert.equal(normal.headerMissing, undefined); + f.persistence.list = async () => { throw new Error('backend offline'); }; + assert.ok((await f.call('/state')).body.sessions.every(row => !row.canForget)); +}); + +test('forget-missing releases only confirmed absent archive markers and supports retry', async t => { + const f = await fixture(t, { modern: true }); + const keep = ['chat-a', 'live', 'denied', 'corrupt', 'wrong-id', 'reappeared']; + f.registry.state.archivedSessionIds = ['gone', ...keep]; + f.services.sessions.get = id => id === 'live' ? { header: { id } } : undefined; + const opened = [], closed = []; + f.persistence.open = async id => { + opened.push(id); + if (id === 'reappeared') return { async close() { closed.push(id); } }; + if (id === 'gone' || id === 'wrong-id') throw Object.assign(new Error('missing'), { + name: 'SessionPersistenceNotFoundError', sessionId: id === 'gone' ? id : 'another-id', + }); + throw Object.assign(new Error('unreadable'), { code: id === 'denied' ? 'EACCES' : 'ENOENT' }); + }; + const request = { sessionIds: ['gone', 'gone', ...keep, 'never-archived'] }; + const result = await f.call('/forget-missing', request); + assert.equal(result.status, 200); + assert.deepEqual(result.body, { removed: ['gone'], kept: keep }); + assert.deepEqual(f.registry.archivedSessionIds, keep); + assert.deepEqual(opened, ['gone', 'denied', 'corrupt', 'wrong-id', 'reappeared']); + assert.deepEqual(closed, ['reappeared']); + assert.deepEqual((await f.call('/forget-missing', { sessionIds: ['gone'] })).body, { removed: [], kept: [] }); +}); + +test('forget-missing preserves markers when the host inventory or deletion authority is unavailable', async t => { + const f = await fixture(t, { modern: true }); + f.registry.state.archivedSessionIds = ['gone']; + const req = { sessionIds: ['gone'] }; + f.persistence.list = async () => { throw new Error('offline'); }; + assert.equal((await f.call('/forget-missing', req)).status, 503); + f.persistence.list = async () => []; + await mkdir(f.data, { recursive: true }); + await writeFile(join(f.data, 'pending-deletions.json'), JSON.stringify({ ids: ['gone'] })); + assert.equal((await f.call('/forget-missing', req)).status, 409); + assert.deepEqual(f.registry.archivedSessionIds, ['gone']); +}); diff --git a/test/package.test.mjs b/test/package.test.mjs index 70a053a..cd4f0fa 100644 --- a/test/package.test.mjs +++ b/test/package.test.mjs @@ -36,6 +36,7 @@ const publicRoutes = [ 'POST /plugins/dsh-archived-chats/deletion/execute', 'POST /plugins/dsh-archived-chats/unarchive', 'POST /plugins/dsh-archived-chats/unarchive-all', + 'POST /plugins/dsh-archived-chats/forget-missing', 'POST /plugins/dsh-archived-chats/delete', 'POST /plugins/dsh-archived-chats/delete-all', 'GET /plugins/dsh-archived-chats/unarchived', diff --git a/test/smoke.test.mjs b/test/smoke.test.mjs index cef1bed..e0c80d9 100644 --- a/test/smoke.test.mjs +++ b/test/smoke.test.mjs @@ -346,7 +346,7 @@ assert(name === 'archived-chats', `plugin name is "archived-chats" (got "${name} assert(routes.size === 0, 'no routes while webServer is unbound'); services.webServer = { register: (route) => { routes.set(route.path, route.handler); return () => routes.delete(route.path); } }; listeners.find(([event]) => event === 'internal/service')?.[1]('webServer'); -assert(routes.size === 27, `twenty-seven public routes registered after webServer binds (got ${routes.size})`); +assert(routes.size === 28, `twenty-eight public routes registered after webServer binds (got ${routes.size})`); for (const path of ['about', 'about/check-updates', 'about/install-update', 'state', 'stats', 'lineage', 'preview', 'preview/image', 'search', 'export', 'import/inspect', 'import/restore', 'metadata', 'deletion-tasks', 'deletion-tasks/retry', 'unarchive', 'unarchive-all', 'delete', 'delete-all', 'unarchived', 'unarchived/export', 'workspace-archive/workspaces', 'workspace-archive/preview', 'workspace-archive/apply']) { assert(routes.has(`/plugins/dsh-archived-chats/${path}`), `route /${path} registered`); } @@ -1534,7 +1534,7 @@ console.log('\n[11a] locale dictionaries — all eight host languages share one const expectedIntl = { zh: 'zh-CN', en: 'en-US', de: 'de-DE', es: 'es-ES', fr: 'fr-FR', ja: 'ja-JP', pt: 'pt-BR', ru: 'ru-RU' }; assert(JSON.stringify(Object.keys(dicts).sort()) === JSON.stringify(Object.keys(expectedIntl).sort()), `all eight host languages are registered (got ${Object.keys(dicts).sort().join(',')})`); - assert(Object.keys(dicts.en).length === 427, `en dictionary has 427 keys (got ${Object.keys(dicts.en).length})`); + assert(Object.keys(dicts.en).length === 431, `en dictionary has 431 keys (got ${Object.keys(dicts.en).length})`); const baseKeys = JSON.stringify(Object.keys(dicts.en).sort()); const placeholders = (text) => (text.match(/\{\w+\}/g) ?? []).sort().join(','); for (const lang of Object.keys(expectedIntl)) {