Skip to content

fix: fail closed on ambiguous delivery reports - #295

Draft
Justinabox wants to merge 1 commit into
mainfrom
agent/delivery-report-correlation-20260730
Draft

fix: fail closed on ambiguous delivery reports#295
Justinabox wants to merge 1 commit into
mainfrom
agent/delivery-report-correlation-20260730

Conversation

@Justinabox

Copy link
Copy Markdown
Owner

Summary

Closes #294.

  • Correlate a delivery report only when its (reference, recipient) identifies exactly one outbound SMS.
  • Persist ambiguous reports with message_id = None without changing either outbound SMS status.
  • Ignore matching inbound SMS records during outbound delivery-report correlation.
  • Cover in-memory ambiguity, SQLite close/reopen persistence, unique matching, and inbound/outbound boundary behavior.

Verification

  • git diff --check
  • PYTHONPATH=. uv run --no-project --with pytest --with pytest-asyncio --with pytest-aiohttp --with pyserial-asyncio --with aiosqlite pytest tests/test_sms_store.py -q → 59 passed
  • PYTHONPATH=. uv run --no-project --with pytest --with pytest-asyncio --with pytest-aiohttp --with pyserial-asyncio --with aiosqlite pytest tests/ -q → 1102 passed

Risk

Intentional fail-closed behavior leaves repeated-reference reports unlinked for operator inspection rather than guessing which outbound message to update. No timestamp heuristics or modem/hardware behavior changed.

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.

Avoid incorrect SMS delivery-status updates when TP-MR repeats

1 participant