Simpl-Resultat/src
le king fu 8cb7e53698
All checks were successful
PR Check / rust (pull_request) Successful in 24m30s
PR Check / frontend (pull_request) Successful in 2m38s
fix(db): serialize DB access to fix "database is locked"; live-update log console
Database lock (the reported 0.10.0 regression):
- tauri-plugin-sql loads SQLite through a default multi-connection sqlx pool
  (Pool::connect => max_connections = 10) and exposes no JS transaction
  primitive. BEGIN and COMMIT issued as separate db.execute calls could land on
  different pooled connections, stranding an open write transaction on an idle
  connection — a permanent write lock until app restart. Triggered when the
  Bilan page's concurrent reads interleaved with an in-flight snapshot save.
- Fix: funnel every db operation through one FIFO lock in db.ts; withTransaction
  holds it across the whole BEGIN..COMMIT so a transaction's statements never
  span connections (and the saves become genuinely atomic). A reentrancy guard
  lets nested getDb() calls run directly instead of deadlocking. Applied to all
  5 transaction sites (saveSnapshotAtomic, upsertSnapshotLines,
  proposeStarterAccounts, applyKeywordWithReassignment, applyMigration) via
  in-place helper extraction. New db.test.ts covers serialization,
  cross-transaction non-interleaving, reentrancy, and lock release on error.

Log console (Settings -> Systems -> Journaux):
- getLogs returned the same mutated array reference, so useSyncExternalStore
  (identity comparison) never re-rendered on a new log -> the console never
  updated live. getLogs now returns an immutable snapshot rebuilt on each
  mutation (stable between mutations, new identity after each).
- Add logInfo/logWarn/logError app-logging API and instrument the snapshot save
  (info on success, error on failure) so DB issues surface in the console.

tsc + 635 vitest + vite build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 16:50:39 -04:00
..
__fixtures__ test(categories): complete test coverage for migration flow (#123) 2026-04-21 19:25:13 -04:00
__integration__ fix(db): serialize DB access to fix "database is locked"; live-update log console 2026-06-30 16:50:39 -04:00
components fix(db): serialize DB access to fix "database is locked"; live-update log console 2026-06-30 16:50:39 -04:00
contexts fix: address reviewer feedback (#54) 2026-04-09 15:46:27 -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(db): serialize DB access to fix "database is locked"; live-update log console 2026-06-30 16:50:39 -04:00
i18n docs(balance): ADR 0015 + guide + architecture + CHANGELOG for per-security detail (#218) 2026-06-06 14:17:03 -04:00
pages feat(balance): detail-account wizard (toggle to detailed at pivot date) (#215) 2026-06-06 13:55:58 -04:00
services fix(db): serialize DB access to fix "database is locked"; live-update log console 2026-06-30 16:50:39 -04:00
shared feat(balance): schema & migrations v14/v15 + types (securities, holdings, account.kind) (#210) 2026-06-06 12:52:55 -04:00
utils feat(balance): account form vehicle field + category rename via custom_label (#203) 2026-06-01 20:50:40 -04:00
App.tsx refactor(settings): split monolithic Settings page into 3 sub-pages (#190) 2026-05-03 09:50:02 -04:00
main.tsx Fix updater latest.json and add log viewer in settings 2026-02-28 21:09:10 -05:00
styles.css feat(categories): add categories standard guide page (#117) 2026-04-20 21:02:38 -04:00
vite-env.d.ts Initial project scaffold: Tauri v2 + React + TypeScript + TailwindCSS v4 2026-02-07 11:05:11 +00:00