Skip to content

fix(logging): use live-safe sqlite read-only mode#886

Open
TZZheng wants to merge 1 commit into
Lingtai-AI:mainfrom
TZZheng:fix/issue-672-sqlite-readonly-mode-telegrambot
Open

fix(logging): use live-safe sqlite read-only mode#886
TZZheng wants to merge 1 commit into
Lingtai-AI:mainfrom
TZZheng:fix/issue-672-sqlite-readonly-mode-telegrambot

Conversation

@TZZheng

@TZZheng TZZheng commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove the unsafe immutable=1 heuristic from live SQLite event-index readers
  • open read-only connections with mode=ro and keep PRAGMA query_only=ON around query execution
  • add a live-reader regression that observes a later writer commit through the same reader object
  • update the services anatomy to describe and cite the live-safe behavior accurately

Validation

  • PYTHONPATH=src python -m pytest -q tests/test_services_logging.py37 passed
  • git diff --check canonical/main...HEAD — passed
  • the original independent review found only an inaccurate anatomy line range; the amended commit points to the verified query implementation

Risk

mode=ro keeps filesystem writes disabled while allowing SQLite to observe later commits. The query allowlist and temporary query_only guard remain intact.

Fixes #672

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.

SQLiteEventIndex read-only path uses immutable=1 heuristic that can produce stale/corrupt reads on live databases

1 participant