Skip to content

fix: 暂时不可访问的文件不要当成删除 - #228

Merged
taekchef merged 5 commits into
mainfrom
codex/finalize-gone-import-safety
Aug 16, 2026
Merged

fix: 暂时不可访问的文件不要当成删除#228
taekchef merged 5 commits into
mainfrom
codex/finalize-gone-import-safety

Conversation

@taekchef

@taekchef taekchef commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #227

实际改动

  • 文件消失只在 entryPresence == .absent 且父位置 .present 时注销该条登记。
  • .present / .inaccessible 都保留登记;不可读不再当成删除。
  • legacyExternal 检查文件的直接父目录,不再永远视为父位置可用。
  • ImportedFileRecovery.resolve 顺序为当前地址 → 书签 → 备用地址;当前地址失败后不再用同一个失败路径当 fallback。
  • 身份不匹配返回 conflict,不绑定替代文件。
  • 重命名 WorkspaceStore+GoneImportedItems.swift / GoneImportedItemTests.swift
  • 删除侧栏 sourceMissingLabel 死参数,以及只给测试用的 UnavailableCourseUnregister.Action

明确未做

  • 不重新迁移资料库,不改《新概念笔记》。
  • 不恢复缺失顶栏或重新选择文件。
  • 503 条 /tmp 登记清理在合并后单独做,不由产品逻辑偷偷完成。
  • 不碰 marketing worktree / PR 宣传页:固定窗口逐页滚动版复活 + 真实截图质感增强 #215
  • 未改 WorkspaceStore.swiftWeiBeiSelfCheck/main.swiftscript/.github/Package.swift

共享文件占用

无。

失败注入

  • 旧实现 SelfCheck 红:after the current path fails, recovery must try lastKnownPath...
  • 旧实现把 isReadableFile == false 当成删除;现改为 entryPresence 三态。
  • 修复后本地 SelfCheck / WebEditorCheck / PiCheck / source-assertion 通过。

验证

  • 本地:prepare_pi_runtime + swift build -c debug + SelfCheck + WebEditorCheck + PiCheck + check_selfcheck_source_assertions.sh + git diff --check 通过
  • CI:合并前等完整 check 绿
  • 不操作真实 App;用户负责最终体验验收

@taekchef
taekchef marked this pull request as ready for review August 16, 2026 09:17
@taekchef
taekchef merged commit 2df3708 into main Aug 16, 2026
2 checks passed
@taekchef
taekchef deleted the codex/finalize-gone-import-safety branch August 16, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

暂时不可访问的导入文件可能被当成删除

1 participant