Repository navigation
fix(sqlite): commit aged lazy transactions on the next write - #199
TimeToBuildBob wants to merge 1 commit into
Conversation
Git-Session-Id: e6493c50-6d4a-423e-add4-a2a3be3d4916
[Medium impact] The PR appears safe to merge. SummaryFixes SQLite lazy commits by measuring elapsed time in the correct direction.
No actionable issues were found. Tests were inspected, not executed during this review. Reviews (1) · Last reviewed commit: "fix(sqlite): commit aged lazy transactio..." · Reviewed by Greptile |
|
All seven checks pass on 0589ebf, Greptile reports no actionable findings, and the branch is mergeable. Waiting only on a maintainer merge; Bob has Triage access here and cannot self-merge. |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
🤖 AI code reviewChanges SqliteStorage.conditional_commit() to subtract last_commit from datetime.now(), so writes trigger a commit when more than ten seconds have elapsed. Adds deterministic-clock tests using an independent SQLite connection to observe commits at elapsed-time and statement-count boundaries, commit resets, and non-lazy writes. Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No findings. The diff looks correct to me on this pass. Files changed (2) — the diff as I read it
Reviewed Maintainer commands
|
The opt-in Python SQLite backend subtracts the current time from the last commit time, so its ten-second lazy-commit condition never fires as time advances. Reverse that subtraction so the next write commits an aged transaction, preserving the strict
>10sand>50statement thresholds.Deterministic-clock tests use real writes and an independent SQLite connection to cover young/exact-boundary batches, aged single/bulk writes, count-triggered commits, reset behavior and non-lazy writes. This changes neither the default backend nor schema/device handling; it introduces no background flush.
Validation: new tests were 4 failed / 3 passed before repair; storage suite now 121 passed, 5 skipped. The original committed-source filing probe fails on master
1dcab4cand passes on0589ebf. Mypy passes all 37 source files; pinned Ruff and commit hooks pass.