fix(fsBridge): handle EBUSY in readFile/readFileBuffer#1754
Conversation
…ning null When a file is locked by another process (common on Windows), fs.readFile throws EBUSY. The catch block only handled ENOENT, causing EBUSY to become an unhandled promise rejection. Return null for EBUSY, consistent with ENOENT handling for inaccessible files. Fixes ELECTRON-D1
Code Review:fix(fsBridge): handle EBUSY in readFile/readFileBuffer (#1754)变更概述本 PR 修复了 Windows 文件系统中 方案评估结论:✅ 方案合理 将 问题清单🔵 LOW — 测试文件:未使用的
|
| # | 严重级别 | 文件 | 问题 |
|---|---|---|---|
| 1 | 🔵 LOW | fsBridge.readFile.test.ts:2 |
未使用的 Mock 导入 |
| 2 | 🔵 LOW | fsBridge.readFile.test.ts:117,122 |
辅助函数可移至外层作用域 |
结论
✅ 批准合并 — 无阻塞性问题
核心修复逻辑正确,测试覆盖 EBUSY/ENOENT/其他错误/成功读取四种场景,所有 CI 检查通过。仅两处 LOW 级别的 lint 警告在测试文件中,不影响正确性。
本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。
- Remove unused Mock type import from vitest - Move setupProviders and makeErrnoError to file scope Review follow-up for #1754
PR Fix 验证报告原始 PR: #1754
总结: ✅ 已修复 2 个 | ❌ 未能修复 0 个 |
Summary
EBUSYerror inreadFileandreadFileBufferproviders by returningnullinstead of re-throwing.pptxfiles) causeEBUSY, which was previously unhandledSentry: ELECTRON-D1 (283 occurrences)
Closes #1753
Test plan