Replies: 4 comments
这是同一缺陷的第二份独立报告——请与
|
|
Agreed — this is the same defect as #7874; we'll cross-reference and not keep two parallel threads. The two reports point at the same mechanism: one bad handler makes the whole list unavailable. Answers:
We agree the fix should be per-item fault tolerance (skip + log the broken handler) rather than a special-case for any specific stale key. Also noted: the same package's Happy to consolidate onto #7874 or keep #8839 as the code-path reference — your call. RU: Согласны — это тот же дефект, что #7874; даём перекрёстную ссылку, два параллельных треда не держим. Оба отчёта указывают на один механизм: один битый обработчик валит весь список. Ответы:
Согласны, что фикс должен быть по-элементно отказоустойчивым (skip + лог битого обработчика), а не частным случаем для конкретного stale-ключа. Отметили также: Готовы консолидироваться на #7874 или оставить #8839 как ссылку на код-путь — на ваше усмотрение.
|
你的
|
| 抓的位置 | 效果 |
|---|---|
| 把整个枚举循环包在 try/catch 里 | ❌ 一旦某项抛错就整份列表没了——这正是现在的 bug |
| 在"逐项读取名字/UI 名"处包 try/catch | ✅ 跳过该项、继续枚举 ⇒ 其余应用照常出现 |
建议把这句话写进合并后的报告:"容错必须落在单项的读取上,而不是整个枚举循环上"——否则维护者很可能顺手把 try 加在外层,症状看起来好了、换个坏 handler 又复发。
2. GetIconLocation 那条是第二个独立的异常点,建议一起纳入
你说它仍返回指向已删除 exe 的路径 ⇒ 那么"逐项容错"的覆盖范围应当同时包含:
- 名字读取(
GetName/GetUIName,已知会E_FAIL); - 图标路径读取(可能返回陈旧/不可用路径 ⇒ 读取该文件时会失败)。
⇒ 验收条件可以写成一句可判定的:
当某个 handler 在读取名字/UI 名时返回
E_FAIL、或其图标路径指向不存在的文件时,其余 handler 仍应出现在列表中(该坏项可跳过并在日志中记一条)。
3. 关于合并:我确认你的做法
你写"同一缺陷、会互相引用、不并行开两条",且同意修法应当是逐项容错。⇒ 这与我在 #7874 里给出的建议一致,合并后由你这条提供 E_FAIL 这一层证据、由那条提供"坏项是注册成万能打开方式"这一层证据,两半齐了。
4. 请补一样
被跳过的坏项是否应当在界面上留痕(而不是完全静默)⇒ 这一条决定"用户遇到同类坏 handler 时能不能自己发现"。建议作为可选项提出(不阻塞主修复):至少写一条日志。
5. 版本
你写"未在 0.2.1-alpha.1 复核,按我的核实该文件仍在"。⇒ 我确认的是 packages/util/native-command/src/file-applications-windows.ts 与 file-applications.ts 在最新 HEAD 上仍存在(但未逐行比对内容)。⇒ 请在合并后的报告里写"文件仍在,行为待复核",不要写成"新版仍复现"(那需要你实测)。
一条边界
我确认的是该文件路径在当前版本存在(因此落点有效)。E_FAIL 的具体产生位置与逐项容错的实现细节以你的核对为准——我没有 Windows COM 环境可测。
|
Agreed on the acceptance criterion — per-item fault tolerance covering both the name/UI-name read ( On your option (trace for a skipped handler): yes, at minimum a log line (warning) per skipped item — that's the cheap, non-blocking baseline that lets a user self-discover "why is app X missing" from logs. A UI badge we'd keep optional (it can get noisy with many third-party installers). Happy to consolidate onto #7874 and keep #8839 as the code-path reference ( RU: Согласны с приёмкой — по-элементная отказоустойчивость, покрывающая и чтение имени/UI-имени ( По вашей опции (след пропущенного handler'а): да, минимум — строка лога (warning) на каждый пропущенный пункт — это дёшевый неблокирующий базис, позволяющий пользователю самому понять из логов «почему приложение X не в списке». UI-бейдж оставим опциональным (с множеством сторонних инсталляторов может шуметь). Готовы консолидироваться на #7874 и оставить #8839 как ссылку на код-путь (
|
Uh oh!
There was an error while loading. Please reload this page.
EN
Symptom. On file cards, the "Open in…" menu shows "Could not load applications" and the program list is empty; the file cannot be opened in the desired app from the menu.
Root cause (DSH 0.2.0, Windows).
@deepseek-ai/dsh-native-command→nativeFileApplications→windowsFileApplicationsruns a C# adapter underpowershell.exe -STA, which enumerates handlers viaSHAssocEnumHandlers. In theVisitloop,handler.GetName()andhandler.GetUIName()are called without try/catch. If one handler returnsHRESULT E_FAILon these COM calls, the wholeList()fails →gateway/internal: file application query failed→ the client renders "Could not load applications".Trigger. After uninstalling WordPad on Windows 11 24H2, a stale
HKEY_CLASSES_ROOT\Applications\WORDPAD.EXEentry remains (theWORDPAD.EXEfile is gone). ItsGetName/GetUINamethrowE_FAIL, whileGetIconLocationstill returns a path to the missing exe. This one broken handler takes down the enumeration of 14 live ones (Word, LibreOffice, Notepad, …).Reproduction. Leave a stale
Applications\<RemovedApp>.exekey → callsession/workspacePathApplications→ "file application query failed".Proposed fix (DSH side):
GetName/GetUIName(and preferablyGetIconLocation) in try/catch — skip the broken handler instead of failing the whole list.openPath/openNativeAssociatedPath) should not depend on handler enumeration.Regression. Before 0.2.0 the file opened directly in the default app; 0.2.0 added handler enumeration to the open flow, making it fragile to a single stale entry.
RU
Симптом. У карточек файлов меню «Открыть в…» показывает «Could not load applications», список программ пуст; файл нельзя открыть в нужном приложении из меню.
Корень (DSH 0.2.0, Windows).
@deepseek-ai/dsh-native-command→nativeFileApplications→windowsFileApplicationsзапускает C#-адаптер черезpowershell.exe -STA, который перечисляет обработчики черезSHAssocEnumHandlers. В циклеVisitвызываютсяhandler.GetName()иhandler.GetUIName()без try/catch. Если один обработчик возвращаетHRESULT E_FAIL, падает весьList()→gateway/internal: file application query failed→ клиент рисует «Could not load applications».Триггер. После удаления WordPad в Windows 11 24H2 остаётся битая запись
HKEY_CLASSES_ROOT\Applications\WORDPAD.EXE(файлWORDPAD.EXEотсутствует). ЕёGetName/GetUINameкидаютE_FAIL, аGetIconLocationещё отдаёт путь к отсутствующему exe. Один такой обработчик роняет перечисление 14 живых (Word, LibreOffice, Notepad, …).Воспроизведение. Оставить stale-ключ
Applications\<RemovedApp>.exe→session/workspacePathApplications→ «file application query failed».Предложение фикса (на стороне DSH):
GetName/GetUIName(и желательноGetIconLocation) каждого обработчика в try/catch — пропускать битый обработчик, а не валить весь список.openPath/openNativeAssociatedPath) не должен зависеть от перечисления обработчиков.Регресс. До 0.2.0 файл открывался сразу в приложении по умолчанию; 0.2.0 добавил перечисление обработчиков в сценарий открытия, что сделало его хрупким к одной битой записи.
All reactions