Repository navigation
[Bug 报告] 外置盘离线时启动 DSH 后,一次工作区写入就会把旧会话永久剔除出工作区登记(落入「未分组」) #9880
Replies: 1 comment
|
Your trace is exact — including the part that matters most for the fix, that the display filter and the write-side prune are the same predicate over the same cache. A fix for the error class you hit has since landed upstream, so the first question is whether you are on a build that has it. The prune you identified has been closed for ENOENT. Commit What
So the two defects you separated — "pruned on write" and "filtered out of the group" — are now one predicate, and a missing directory is exempt from both. The new tests pin the negative side as well: That narrowness is where your case could still be living. Retention keys on the error code, not on "the path did not resolve at index time". A removable or otherwise not-ready volume does not always report The discriminator is already in your logs. On a build with the fix, run the same sequence and watch for the warn — If that line appears on Two of your observations are also worth recording as still-valid detail on master:
For records that were already pruned, before the fix, there is an existing tool: If you can re-run the sequence on a current build, the two things worth reporting back are: whether the filtered-session warn appears at all (i.e. whether your failure is |
Uh oh!
There was an error while loading. Please reload this page.
环境
E:\...),~\.dsh在系统盘现象
工作区建在移动硬盘上。DSH 在硬盘未挂载时启动过一次;之后(硬盘已重新接上)在同一工作区新建了一条会话,侧栏里该工作区原有的那条会话就滑进了「未分组」。此后无论硬盘在不在线、重启多少次都不会自动归位——
~\.dsh\storages\workspace.json里该工作区的sessionIds已经把旧会话永久丢掉了。根因(引自安装包
resources/app.asar打包产物,符号名保留)工作区归属 = 注册表记录里的
sessionIds,再叠加一层按「会话 cwd 规范化路径」做的运行时过滤。问题在于这两处共用一个只在启动时全量重建的路径缓存sessionPaths:1. 启动索引:cwd 一时解析不到,会话就被记为无效
启动时外置盘离线 →
stat失败 → 该会话只进invalidSessionPaths。运行期只有活跃会话会被补录(indexLiveSessions),全量重索引只发生在启动:2. 每次写工作区记录都会修剪成员,并立即落盘
显示过滤是同一套逻辑:
而
sessionPath(id)就是sessionPaths.get(id)。于是:「启动时盘没插上」的会话,在该工作区下一次任何写入(新建会话 attach、改名、排序……)时被静默永久剔除;显示层则是缓存未命中就直接不进分组——这就是「未分组」的来源。新会话自己安然无恙,因为 attach 时走了
rememberSessionPath:attachSession()对新会话做realpath校验(此刻盘已挂上,通过)并记下它的路径,随后那次mutate修剪只把「记不得路径」的旧会话踢掉。bootstrap()(按 cwd 归并历史会话)只在!state.initialized时运行,重启不能自愈。复现步骤(确定性)
E:\WS新建工作区,在其中开一条会话 S1 → 正常分组;invalidSessionPaths);sessionIds中永久剔除并落盘,滑入「未分组」;重启不恢复。期望行为
reportFilteredCandidates()目前只写日志;这种会写盘的丢失建议至少给出可见提示和恢复入口。影响
insertSessionBefore()(拖拽换组)同样走mutate修剪,缓存未命中时拖拽也救不回来;当前补救方法(可供文档/回复引用)
手工编辑
~\.dsh\storages\workspace.json,把 sessionId 补回对应工作区的sessionIds,然后带着盘重启 DSH。证据(本例时间线)
cwd与工作区记录path字符串完全一致(排除用户配置问题);updatedAt恰好等于新会话创建+attach 的时刻,与「修剪写盘」的时间线吻合;All reactions