github yuzeguitarist/Deck v1.0.0(fix)
v1.0.0(fix) | Hotfix

latest releases: v1.4.5, v1.4.4, v1.4.3...
8 months ago

Deck

Deck

A modern, native, privacy-first clipboard OS for macOS


Release Notes v1.0.0 (fix)

修复 / Fixes

  • 数据库文件有效性检查:新增 isDatabaseFileValid(),在每次数据库操作前检查文件是否存在且可读,防止异常文件导致崩溃。
    Database file validity check: Added isDatabaseFileValid() 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 returns nil instead of crashing.
  • SQL 遍历安全修复:将 PRAGMA 与 FTS 查询从不安全的 for-in 迭代改为使用 failableNext(),避免 try! 引发致命错误。
    Safe SQL iteration: Replaced unsafe for-in iteration with failableNext() for PRAGMA and FTS queries to avoid fatal errors caused by try!.


技术说明 / Technical Notes

  • db.prepare(Table query) 返回 AnySequence<Row>,其内部迭代器使用 try!,无法在外部安全捕获错误。
    db.prepare(Table query) returns AnySequence<Row>, whose internal iterator uses try! and cannot be safely controlled externally.

  • db.prepare(String SQL) 返回 Statement,可直接调用 failableNext() 实现安全错误处理。
    db.prepare(String SQL) returns Statement, which allows safe iteration via failableNext().

  • 在执行前增加文件有效性校验,可以防止绝大多数因数据库文件被删除或移动导致的崩溃。
    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.

Don't miss a new Deck release

NewReleases is sending notifications on new releases.