Every lock of the store goes through Db::conn

Db::conn is documented as the one way to take the lock, yet five production and
test sites reached past it with db.0.lock(): the startup summary, the desktop's
trash sweep and config_get, and tests in sharing and update. All five now call
conn().

DRY pass #2, batch 2, F8 (#5372).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 14:23:07 -04:00
co-authored by Claude Opus 5.5
parent 63dd206b91
commit ee771e3734
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ fn paint_window_before_the_webview_does(app: &tauri::App) {
/// user is present for is one they can see the result of. A failure here is logged and
/// stepped over — housekeeping must never be the reason the app won't open.
fn sweep_local_trash(db: &local::Db) {
let conn = match db.0.lock() {
let conn = match db.conn() {
Ok(conn) => conn,
Err(_) => {
log::warn!("skipping the trash sweep: store lock poisoned");