Skip to content

fix(portable): 避免数据目录切换时丢失设置和代码片段 - #6771

Draft
zipg wants to merge 1 commit into
t8y2:mainfrom
zipg:codex/fix-windows-portable-persistence
Draft

fix(portable): 避免数据目录切换时丢失设置和代码片段#6771
zipg wants to merge 1 commit into
t8y2:mainfrom
zipg:codex/fix-windows-portable-persistence

Conversation

@zipg

@zipg zipg commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

问题

Windows 便携版的数据目录发生切换时,启动兜底迁移仅将连接、历史和 SQL 库等表识别为用户数据。app_settingsapp_state 未被识别,导致仅保存了设置或自定义代码片段的数据库被误判为空,启动后表现为恢复默认。

修复

  • 将设置、编辑器状态、代码片段及其他持久化用户表纳入数据存在性判断
  • 允许仅包含设置和代码片段的源数据库参与兜底迁移
  • 目标数据库已有设置时保持不覆盖
  • 修正“空目标数据库”测试,使其只包含初始化 schema

验证

  • cargo test -p dbx-core import_user_data_db --lib:7 passed
  • cargo test -p dbx-core --lib:5164 passed, 0 failed, 59 ignored(变基前全量验证)
  • cargo test --manifest-path src-tauri/Cargo.toml data_dir --lib:9 passed(变基前验证)
  • cargo fmt --all -- --check
  • git diff --check

待验证

当前开发环境为 macOS,尚未完成 Windows 便携版实际退出、重启及数据目录切换验证,因此先提交为草稿 PR。

@github-actions github-actions Bot added area/core Shared DBX core runtime bug Something isn't working labels Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Shared DBX core runtime bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant