Repository navigation
fix(data): migrate legacy Windows data directory on upgrade - #273
Merged
Merged
Conversation
- Copy `settings.json`, `rclone.conf` and the default `data` directory from the install directory to `%APPDATA%\OpenList Desktop` on first launch, keeping the originals as backup - Rewrite the absolute `db_file`, `temp_dir`, `bleve_dir` and `log.name` paths in the copied core `config.json` so OpenList Core uses the migrated files - Skip the migration when the per-user `settings.json` already exists, and log a warning instead of blocking startup on failure Fixes #251 Co-authored-by: LunelleEverdawn <lunelle+suyunmeng@oplist.org>
- Pin the `rust-check` and `build-test` jobs to `nightly-2026-10-31` (rustc 92b5b8c87), the last nightly that passed CI - Avoid the `nightly-2026-11-01` regression that fails to compile `zbus` with E0391 on Linux and newly denies `clippy::new_instead_of_clear` in existing code Co-authored-by: LunelleEverdawn <lunelle+suyunmeng@oplist.org>
- Replace the floating `nightly` toolchain with `1.99.1` in the lint, build test and release workflows, so a daily nightly update can no longer break CI or release builds - Drop the temporary `nightly-2026-10-31` pin in the lint workflow Co-authored-by: LunelleEverdawn <lunelle+suyunmeng@oplist.org>
- Use `dtolnay/rust-toolchain@stable` instead of the pinned `1.99.1` in the lint, build test and release workflows, so CI and release builds follow the latest stable Rust release Co-authored-by: LunelleEverdawn <lunelle+suyunmeng@oplist.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
Since v0.8.0 (#108), the Windows data directory moved from the install directory to
%APPDATA%\OpenList Desktop, but no migration was added. After upgrading from v0.7.0, the app creates a freshsettings.jsonand OpenList Core starts with an empty data directory, so previously configured storages disappear.自 v0.8.0(#108)起,Windows 的数据目录从安装目录改到了
%APPDATA%\OpenList Desktop,但没有做迁移。从 v0.7.0 升级后,程序会新建默认的settings.json,OpenList Core 使用空的数据目录启动,原先配置的存储因此消失。On first launch, copy
settings.json,rclone.confand the defaultdatadirectory from the install directory to%APPDATA%\OpenList Desktop. The originals are kept in place as a backup.OpenList Core stores absolute paths in
config.jsonand does not re-derive them from--data, sodatabase.db_file,temp_dir,bleve_dirandlog.nameunder the old data directory are rewritten to the new location. Custom paths outside it are left unchanged.The migration runs only when the per-user
settings.jsondoes not exist yet and the install directory has one. Existing files in the new location are never overwritten. If copyingdatafails, the partial copy is removed so the next launch retries. A failure is logged as a warning and does not block startup.Windows only. Users who already launched v0.8.0+ (and therefore already have a per-user
settings.json) are not migrated automatically.首次启动时,将安装目录中的
settings.json、rclone.conf和默认data目录复制到%APPDATA%\OpenList Desktop,原文件保留作为备份。OpenList Core 在
config.json中保存的是绝对路径,且不会根据--data重新计算,因此会把位于旧数据目录下的database.db_file、temp_dir、bleve_dir、log.name改写到新位置,旧数据目录之外的自定义路径保持不变。仅当用户目录下还没有
settings.json、而安装目录中存在时才会迁移,不会覆盖新位置已有的文件。复制data失败时会删除不完整的副本,下次启动重试。迁移失败只记录警告,不阻断启动。仅针对 Windows。已经启动过 v0.8.0 及以上版本(用户目录下已有
settings.json)的用户不会被自动迁移。This PR has breaking changes.
/ 此 PR 包含破坏性变更。
This PR changes public API, config, storage format, or migration behavior.
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
This PR requires corresponding changes in related repositories.
/ 此 PR 需要关联仓库同步修改。
Related Issues / 关联 Issue
Fixes #251
Testing / 测试
rustfmt --check --edition 2024on the changed files with the repositoryrustfmt.toml: passed.cargo check/cargo clippy: not run. The local toolchains could not build (GNU target is missingdlltool.exe, MSVC target is missing the C++ build tools). Relying on CI for compile and clippy checks.Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Translation / 翻译
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。