Deck
A modern, native, privacy-first clipboard OS for macOS
Release Notes v1.0.0 (fix)
修复 / Fixes
-
数据库文件有效性检查:新增
isDatabaseFileValid(),在每次数据库操作前检查文件是否存在且可读,防止异常文件导致崩溃。
Database file validity check: AddedisDatabaseFileValid()to verify that the database file exists and is readable before each operation. -
withDB 执行流程加固:在执行前校验数据库文件有效性;当文件无效或被删除时:
- 记录警告日志
- 触发错误处理机制并通知用户
- 异步尝试重新初始化数据库
- 返回
nil而不是触发崩溃
Hardened withDB flow: Validate the database file before execution. If invalid or missing, the app logs a warning, notifies the user, attempts async recovery, and returnsnilinstead of crashing.
-
SQL 遍历安全修复:将 PRAGMA 与 FTS 查询从不安全的
for-in迭代改为使用failableNext(),避免try!引发致命错误。
Safe SQL iteration: Replaced unsafefor-initeration withfailableNext()for PRAGMA and FTS queries to avoid fatal errors caused bytry!.
技术说明 / Technical Notes
-
db.prepare(Table query)返回AnySequence<Row>,其内部迭代器使用try!,无法在外部安全捕获错误。
db.prepare(Table query)returnsAnySequence<Row>, whose internal iterator usestry!and cannot be safely controlled externally. -
db.prepare(String SQL)返回Statement,可直接调用failableNext()实现安全错误处理。
db.prepare(String SQL)returnsStatement, which allows safe iteration viafailableNext(). -
在执行前增加文件有效性校验,可以防止绝大多数因数据库文件被删除或移动导致的崩溃。
Validating the database file before execution prevents most crashes caused by deleted or moved database files.
兼容性与行为说明 / Compatibility & Behavior Notes
-
本次更新不涉及数据库结构与数据格式变更,可直接覆盖升级。
This release introduces no database schema or data format changes and supports in-place upgrades. -
所有处理逻辑均在本地完成,不上传、不存储任何用户数据。
All processing remains local with no data uploaded or stored remotely.
升级建议 / Upgrade Notes
- 强烈建议所有用户升级以避免潜在的数据损坏与程序崩溃风险。
All users are strongly recommended to upgrade to prevent potential crashes and data corruption.