Skip to content

fix: 修正 SQLite SQL 阻塞 UI 與取消無效 - #44

Merged
NickYCLin merged 1 commit into
masterfrom
fix/sqlite-responsive-cancellation
Oct 14, 2026
Merged

NickYCLin merged 1 commit into
masterfrom
fix/sqlite-responsive-cancellation

Conversation

@NickYCLin

Copy link
Copy Markdown
Collaborator

後續 SQLite 修正(不重做 PR #42/#43)

SQLite async ADO 同步計算改在背景執行,原生 progress handler 每 1000 VM 指令檢查取消;callback 只在 native 執行緒運行,先解除再釋放連線。不以放棄 task 冒充停止,沿用 gate 直到查詢停止。取消訊息明示先前 autocommit 語句不會回滾。

實際驗證

  • Release CrossPlatform build:0 warning / 0 error。
  • 32/32 smoke:實際隔離 SQLite 50,000,000 次 recursive 計算,快速返回、三次取消、後續查詢、一般 SQL error、已提交 DML 保留。
  • Xvfb 正式 Avalonia SQL/Cancel handlers:UI tick、重複 SQL、busy edit/delete/connect、取消後查詢成功及 session 保留,共 14 項 PASS。

精確限制

SQLite busy/lock 等待仍受 provider timeout;本次不宣稱所有 metadata 同步 API 背景化。沒有使用者 DB 或秘密,沒有真 SQL Server 降版矩陣/SQL auth+SSH 真機驗證。待精確 head CI 通過後正常合併;不触發 release。

SQLite 的 async ADO 呼叫仍同步執行,原先讓取消按鈕與快捷鍵在計算期間無法回應。SQL 與執行計畫改由背景工作執行,並用原生 progress handler 檢查取消,解除 callback 後才釋放連線。操作鎖仍等查詢真正停止才釋放,取消訊息不宣稱已提交 SQL 回滾。

加入隔離 SQLite 長計算、取消後查詢與已提交 DML 回歸,桌面 harness 改用正式 SQL 與 Cancel handlers 驗證 UI tick 和重複點擊。
@NickYCLin
NickYCLin merged commit a4e8579 into master Oct 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant