Simpl-Resultat/src
le king fu 89ee648629 fix(db): run every statement on one connection of the plugin's pool (#543)
tauri-plugin-sql opens each database with Pool::connect, a sqlx pool of
up to ten connections, and sqlx gives a connection back to its pool
through a spawned task. Two statements sent back to back made the pool
open a second connection and serve both in turn, so a transaction of
withTransaction was split: its BEGIN and first write on one connection,
a later write on the other, which waited for the first one's write lock
and failed with "database is locked" (code 5) after 5 s. Adding a keyword
from the right-click menu (six statements) and creating a sub-category
hit it; the 14 withTransaction call sites were exposed.

Right after Database.load, inside the exclusive section that opens a
profile, loadUnlocked now calls use_single_connection_pool, a new Tauri
command (db_pool_commands.rs) that replaces the plugin's DbPool::Sqlite
in DbInstances by a pool of one connection, never recycled, opened with
the plugin pool's own connect options, then closes the plugin's pool.
getDb() and withTransaction find the connection only once the switch
succeeded; a failed switch writes a folder-free Journal line, closes the
plugin's pool and fails the opening.

sqlx 0.8.6 becomes a direct dependency with features the plugin already
enables: Cargo.lock only gains the edge, no package.

test: reproduces #543. The Rust tests replay, on a real sqlx pool opened
like the plugin's, the statements of a keyword on one then two checked
transactions (one split) and of a sub-category: code 5 on the plugin's
pool, green after the swap (6 of 6 red on a no-op swap). db.test.ts pins
the place of the switch and its failure path.

Fixes #543

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 01:18:43 +00:00
..
__fixtures__ feat: recognise BMO exports by name (#488) 2026-11-09 20:40:19 -05:00
__integration__ test: count a manual transaction's link in the whole-history summary (#522) 2026-11-08 20:24:53 -05:00
components fix: unlink Balance transfers from the window and the import history (#522) 2026-11-08 20:05:12 -05:00
contexts feat(onboarding): visit steps, eight rows, "Got it" and one-time initialization 2026-10-13 21:32:20 -04:00
data feat(categories): add v1 IPC seed, i18n keys, and migration v8 (#115) 2026-04-19 16:41:55 -04:00
hooks fix: unlink Balance transfers from the window and the import history (#522) 2026-11-08 20:05:12 -05:00
i18n feat: recognise BMO exports by name (#488) 2026-11-09 20:40:19 -05:00
pages fix: unlink Balance transfers from the window and the import history (#522) 2026-11-08 20:05:12 -05:00
services fix(db): run every statement on one connection of the plugin's pool (#543) 2026-11-14 01:18:43 +00:00
shared fix: count every report by the signed balance of its categories (#392) 2026-11-07 22:32:30 -05:00
test test: refuse a nested transaction in the SQLite harness (#392) 2026-11-08 11:17:12 -05:00
utils feat: recognise BMO exports by name (#488) 2026-11-09 20:40:19 -05:00
App.tsx fix: replace the home and profile folders exactly in the Journal (#497) 2026-10-26 21:24:35 -04:00
main.tsx fix: replace the home and profile folders exactly in the Journal (#497) 2026-10-26 21:24:35 -04:00
styles.contrast.test.ts fix(onboarding): give the focus ring back to the highlighted control 2026-10-08 21:05:30 -04:00
styles.css fix(onboarding): give the focus ring back to the highlighted control 2026-10-08 21:05:30 -04:00
vite-env.d.ts Initial project scaffold: Tauri v2 + React + TypeScript + TailwindCSS v4 2026-02-07 11:05:11 +00:00