What's Changed
Critical Fix: Data Loss During In-App Update
- Flush SwiftData WAL (Write-Ahead Log) on app termination to prevent database corruption
- Force a backup right before applying updates, ensuring a fresh recovery point
- Replace
sleep 2with PID-based polling in update and restore scripts — waits for the app to actually exit instead of guessing - Graceful recovery mode: if database fails to open, app launches with a temporary store and prompts user to restore from backup or locate files manually (no more crash loops)
- Flush ModelContext before backup restore to prevent old in-memory data from overwriting restored files
Minor Improvements
- Sort preference now persists across app restarts
更新内容
关键修复:应用内更新时数据丢失
- 退出时强制刷新 SwiftData WAL(预写日志),防止数据库不一致
- 更新前自动创建备份,确保有可恢复的数据
- 更新和恢复脚本改用进程 PID 轮询等待,确保 app 完全退出后再操作(替代原来不可靠的固定等待)
- 数据库损坏时不再崩溃循环:改为降级启动并弹窗引导用户从备份恢复或手动定位数据库文件
- 备份恢复前先刷新数据库写入,防止旧数据覆盖恢复的文件
其他改进
- 排序偏好现在会跨重启保持
Full Changelog: v1.3.0...v1.3.1