Skip to content

fix: report failed automatic deliveries - #4

Merged
AliZakaee merged 1 commit into
mainfrom
automation/maintenance-20260807-evening-auto-delivery-alerts
Aug 7, 2026
Merged

AliZakaee merged 1 commit into
mainfrom
automation/maintenance-20260807-evening-auto-delivery-alerts

Conversation

@AliZakaee

Copy link
Copy Markdown
Owner

Summary

  • distinguish partial Telegram auto-reply delivery from an unconfirmed send
  • alert the owner with the customer and delivery outcome so they can inspect the chat before retrying
  • preserve the invariant that outbound history and conversation memory are written only after complete delivery
  • add regression coverage for both failure modes

Why this is meaningful

Automatic replies can exceed Telegram's single-message limit and be delivered in chunks. The send adapter already reports when a later chunk fails, but the auto-reply pipeline previously allowed that exception to reach a log-only wrapper. A customer could receive a truncated reply while the owner saw no alert. Complete send failures were similarly invisible outside logs. This change makes those system-level outcomes actionable without changing successful sends, approval mode, storage schemas, or public interfaces.

Validation

  • Baseline: .venv/bin/pytest — passed, 276 tests
  • Targeted: .venv/bin/pytest tests/unit/handlers/test_business_updates.py -q — passed, 18 tests
  • CI-equivalent: .venv/bin/pytest --cov=. --cov-report=term-missing --cov-report=xml --cov-report=html --junitxml=junit.xml — passed, 278 tests; 60% total coverage
  • Syntax: .venv/bin/python -m compileall -q config.py database.py handlers services telegram_api.py utils.py tests — passed
  • Diff hygiene: git diff --check — passed
  • Secret/forbidden-path scan — passed; only the handler and its unit tests changed

The local Python 3.9 runtime emitted urllib3's existing LibreSSL compatibility warning; it did not affect the passing suite. Remote CI covers the supported Python 3.10, 3.11, and 3.12 matrix.

Risk and rollback

Risk is low: failure paths now send one additional owner alert, while the success path is unchanged. Roll back by reverting the feature commit.

Prepared with automated assistance by EQ for AliZakaee.

@AliZakaee
AliZakaee merged commit 6318d12 into main Aug 7, 2026
7 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.

1 participant