Skip to content

DelayCommit silencing is broken in two ways#82

Merged
roed314 merged 1 commit into
roed314:masterfrom
roed-math:fix/delaycommit
Jul 20, 2026
Merged

DelayCommit silencing is broken in two ways#82
roed314 merged 1 commit into
roed314:masterfrom
roed-math:fix/delaycommit

Conversation

@roed-math

Copy link
Copy Markdown

DelayCommit(silence=True) wrote obj._silenced, but base.py reads and the exit path restores obj._db._silenced — so silencing was a no-op unless the context object was the database. Fixed to set the attribute that is actually read, and verified against the real logging machinery rather than a mock.

That exposed the second half: silence= was applied even when active=False, but __exit__ only restores under active — and reload_all uses exactly DelayCommit(..., silence=True, active=False), which would have silenced the database permanently. The flag is now gated on active.


Split out of #60 (one PR per issue). This branch carries only this issue's fix and its tests; the rest of the known-bug inventory stays xfailed, so the full suite is green here and the strict markers guarantee no cross-issue leakage.

DelayCommit(silence=True) wrote obj._silenced, but base.py reads and the exit path restores obj._db._silenced — so silencing was a no-op unless the context object *was* the database. Fixed to set the attribute that is actually read, and verified against the real logging machinery rather than a mock.

That exposed the second half: silence= was applied even when active=False, but __exit__ only restores under active — and reload_all uses exactly DelayCommit(..., silence=True, active=False), which would have silenced the database permanently. The flag is now gated on active.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@roed314
roed314 merged commit afab9f3 into roed314:master Jul 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants