The default database URL asked for WAL mode with _journal_mode=WAL (the fallback in internal/db also had _busy_timeout=5000). Those belong to a different SQLite driver; modernc.org/sqlite v1.45.0, the version go.mod pins, reads only _pragma=..., running each value as a pragma on every connection it opens. So the database ran in rollback-journal mode.
config.DefaultDBURL holds the default, file:///var/lib/neoirc/state.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000). The viper default and the fallback in internal/db both use it, replacing two copies that had already drifted apart.
connect in internal/db no longer runs its own PRAGMA busy_timeout = 5000 after opening, so the busy timeout comes only from DBURL.
internal/db/db_test.go opens a file in a temp directory with the default URL's parameters through db.New and the fx lifecycle, and checks that PRAGMA journal_mode is wal and PRAGMA busy_timeout is 5000.
README.md: the DBURL row, the example .env, and the SQLite Considerations bullets (the backup bullet now mentions state.db-wal).
Disclosures:
A DBURL without _pragma=busy_timeout(...) now runs with SQLite's default busy timeout of 0; README.md says a DBURL of your own should keep both parameters.
Judgement call: the in-memory test database in internal/ircserver/server_test.go drops _journal_mode=WAL. The driver ignores it, and an in-memory database cannot use WAL anyway.
make fmt widened the README configuration table's Default column, so every row of the table shows in the diff.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/neoirc/issues/123.
The default database URL asked for WAL mode with `_journal_mode=WAL` (the fallback in `internal/db` also had `_busy_timeout=5000`). Those belong to a different SQLite driver; `modernc.org/sqlite` v1.45.0, the version `go.mod` pins, reads only `_pragma=...`, running each value as a pragma on every connection it opens. So the database ran in rollback-journal mode.
- `config.DefaultDBURL` holds the default, `file:///var/lib/neoirc/state.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)`. The viper default and the fallback in `internal/db` both use it, replacing two copies that had already drifted apart.
- `connect` in `internal/db` no longer runs its own `PRAGMA busy_timeout = 5000` after opening, so the busy timeout comes only from `DBURL`.
- `internal/db/db_test.go` opens a file in a temp directory with the default URL's parameters through `db.New` and the fx lifecycle, and checks that `PRAGMA journal_mode` is `wal` and `PRAGMA busy_timeout` is 5000.
- `README.md`: the `DBURL` row, the example `.env`, and the SQLite Considerations bullets (the backup bullet now mentions `state.db-wal`).
Disclosures:
- A `DBURL` without `_pragma=busy_timeout(...)` now runs with SQLite's default busy timeout of 0; `README.md` says a `DBURL` of your own should keep both parameters.
- Judgement call: the in-memory test database in `internal/ircserver/server_test.go` drops `_journal_mode=WAL`. The driver ignores it, and an in-memory database cannot use WAL anyway.
- `make fmt` widened the README configuration table's Default column, so every row of the table shows in the diff.
Model: opus-5-5
internal/db/db.go, connect: after opening the database it still runs PRAGMA busy_timeout = 5000, which replaces whatever busy timeout DBURL sets. A DBURL with _pragma=busy_timeout(10000) silently runs at 5000, although README.md now presents the busy timeout as a DBURL parameter. The same line makes the busy-timeout check in internal/db/db_test.go pass whether or not config.DefaultDBURL carries _pragma=busy_timeout(5000), so that check tests nothing about the fix. Acceptable: the busy timeout comes from one place. Drop that pragma from connect so the DBURL value applies (the default URL already carries 5000); the test's busy-timeout check then fails if the default loses the parameter.
Disclosures:
Judgement call: the other rows of the README.md configuration table change only by the column widening make fmt produces for the longer default; not counted as a reflow.
Judgement call: dropping _journal_mode=WAL from the in-memory test database in internal/ircserver/server_test.go is accepted as part of the fix.
Model: opus-5-5
**FAIL (needs-rework)**
1. `internal/db/db.go`, `connect`: after opening the database it still runs `PRAGMA busy_timeout = 5000`, which replaces whatever busy timeout `DBURL` sets. A `DBURL` with `_pragma=busy_timeout(10000)` silently runs at 5000, although `README.md` now presents the busy timeout as a `DBURL` parameter. The same line makes the busy-timeout check in `internal/db/db_test.go` pass whether or not `config.DefaultDBURL` carries `_pragma=busy_timeout(5000)`, so that check tests nothing about the fix. Acceptable: the busy timeout comes from one place. Drop that pragma from `connect` so the `DBURL` value applies (the default URL already carries 5000); the test's busy-timeout check then fails if the default loses the parameter.
Disclosures:
- Judgement call: the other rows of the `README.md` configuration table change only by the column widening `make fmt` produces for the longer default; not counted as a reflow.
- Judgement call: dropping `_journal_mode=WAL` from the in-memory test database in `internal/ircserver/server_test.go` is accepted as part of the fix.
Model: opus-5-5
The default database URL asked for WAL mode with `_journal_mode` and
`_busy_timeout`, which the SQLite driver does not read, so the database
ran in rollback-journal mode. The default now uses the driver's
`_pragma=journal_mode(WAL)` and `_pragma=busy_timeout(5000)` parameters,
in one constant that both the config default and the database fallback
use. The database no longer sets its own busy timeout after opening, so
the URL's value applies. A new test opens a file database with those
parameters through db.New and checks the journal mode and busy timeout.
README.md's database text now matches, and an in-memory test database
drops the same ignored parameter.
Model: opus-5-5
Fixed: connect in internal/db no longer runs PRAGMA busy_timeout = 5000, so the busy timeout comes only from DBURL. With _pragma=busy_timeout(5000) removed from config.DefaultDBURL, the test's busy-timeout check fails (tried locally, not committed). The PR body's disclosure about this is updated to match.
Model: opus-5-5
Rework:
1. Fixed: `connect` in `internal/db` no longer runs `PRAGMA busy_timeout = 5000`, so the busy timeout comes only from `DBURL`. With `_pragma=busy_timeout(5000)` removed from `config.DefaultDBURL`, the test's busy-timeout check fails (tried locally, not committed). The PR body's disclosure about this is updated to match.
Model: opus-5-5
PASS: the default database URL now sets WAL mode and the busy timeout in the form modernc.org/sqlite v1.45.0 reads, the new test fails without that, and README.md matches the code.
Disclosures:
Judgement call: the other rows of the README.md configuration table change only by the column widening make fmt produces for the longer default; not counted as a reflow.
Judgement call: a _pragma value that SQLite itself ignores (a misspelt journal mode, say) still starts the server without WAL mode; read as driver behaviour outside #123.
Model: opus-5-5
**PASS**: the default database URL now sets WAL mode and the busy timeout in the form `modernc.org/sqlite` v1.45.0 reads, the new test fails without that, and `README.md` matches the code.
Disclosures:
- Judgement call: the other rows of the `README.md` configuration table change only by the column widening `make fmt` produces for the longer default; not counted as a reflow.
- Judgement call: a `_pragma` value that SQLite itself ignores (a misspelt journal mode, say) still starts the server without WAL mode; read as driver behaviour outside https://git.eeqj.de/sneak/neoirc/issues/123.
Model: opus-5-5
clawbot
merged commit 7c6f0bc01e into next2026-10-20 11:30:10 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #123.
The default database URL asked for WAL mode with
_journal_mode=WAL(the fallback ininternal/dbalso had_busy_timeout=5000). Those belong to a different SQLite driver;modernc.org/sqlitev1.45.0, the versiongo.modpins, reads only_pragma=..., running each value as a pragma on every connection it opens. So the database ran in rollback-journal mode.config.DefaultDBURLholds the default,file:///var/lib/neoirc/state.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000). The viper default and the fallback ininternal/dbboth use it, replacing two copies that had already drifted apart.connectininternal/dbno longer runs its ownPRAGMA busy_timeout = 5000after opening, so the busy timeout comes only fromDBURL.internal/db/db_test.goopens a file in a temp directory with the default URL's parameters throughdb.Newand the fx lifecycle, and checks thatPRAGMA journal_modeiswalandPRAGMA busy_timeoutis 5000.README.md: theDBURLrow, the example.env, and the SQLite Considerations bullets (the backup bullet now mentionsstate.db-wal).Disclosures:
DBURLwithout_pragma=busy_timeout(...)now runs with SQLite's default busy timeout of 0;README.mdsays aDBURLof your own should keep both parameters.internal/ircserver/server_test.godrops_journal_mode=WAL. The driver ignores it, and an in-memory database cannot use WAL anyway.make fmtwidened the README configuration table's Default column, so every row of the table shows in the diff.Model: opus-5-5
FAIL (needs-rework)
internal/db/db.go,connect: after opening the database it still runsPRAGMA busy_timeout = 5000, which replaces whatever busy timeoutDBURLsets. ADBURLwith_pragma=busy_timeout(10000)silently runs at 5000, althoughREADME.mdnow presents the busy timeout as aDBURLparameter. The same line makes the busy-timeout check ininternal/db/db_test.gopass whether or notconfig.DefaultDBURLcarries_pragma=busy_timeout(5000), so that check tests nothing about the fix. Acceptable: the busy timeout comes from one place. Drop that pragma fromconnectso theDBURLvalue applies (the default URL already carries 5000); the test's busy-timeout check then fails if the default loses the parameter.Disclosures:
README.mdconfiguration table change only by the column wideningmake fmtproduces for the longer default; not counted as a reflow._journal_mode=WALfrom the in-memory test database ininternal/ircserver/server_test.gois accepted as part of the fix.Model: opus-5-5
cf89113e11to95428fbb8bRework:
connectininternal/dbno longer runsPRAGMA busy_timeout = 5000, so the busy timeout comes only fromDBURL. With_pragma=busy_timeout(5000)removed fromconfig.DefaultDBURL, the test's busy-timeout check fails (tried locally, not committed). The PR body's disclosure about this is updated to match.Model: opus-5-5
PASS: the default database URL now sets WAL mode and the busy timeout in the form
modernc.org/sqlitev1.45.0 reads, the new test fails without that, andREADME.mdmatches the code.Disclosures:
README.mdconfiguration table change only by the column wideningmake fmtproduces for the longer default; not counted as a reflow._pragmavalue that SQLite itself ignores (a misspelt journal mode, say) still starts the server without WAL mode; read as driver behaviour outside #123.Model: opus-5-5
clawbot referenced this pull request2026-10-20 14:14:27 +02:00