Skip to content

Fix stale approvals after customer message edits - #6

Merged
AliZakaee merged 1 commit into
mainfrom
automation/maintenance-20260811-early-evening-invalidate-edited-approvals
Aug 11, 2026
Merged

AliZakaee merged 1 commit into
mainfrom
automation/maintenance-20260811-early-evening-invalidate-edited-approvals

Conversation

@AliZakaee

Copy link
Copy Markdown
Owner

Summary

  • invalidate a pending approval when its source customer message is edited
  • keep the invalidation active even when owner monitoring notifications are disabled
  • notify the owner when an edit cancels a stale proposal
  • cover customer edits, monitoring-off behavior, and owner edits with regression tests

Why this is meaningful

Before this change, an approval card remained sendable after the customer changed the underlying message. The owner could therefore approve and deliver a response generated for stale text. The edit handler now reuses the same pending-only atomic invalidation path as the deletion handler, while leaving owner edits and already-handled deliveries untouched.

Validation

  • Baseline: .venv/bin/python -m pytest — 279 passed
  • Baseline CI-equivalent suite: .venv/bin/python -m pytest --cov=. --cov-report=term-missing --cov-report=xml --cov-report=html --junitxml=junit.xml — 279 passed, 60% total coverage
  • Targeted: .venv/bin/python -m pytest tests/unit/handlers/test_business_updates.py -q — 21 passed
  • Post-change CI-equivalent suite: .venv/bin/python -m pytest --cov=. --cov-report=term-missing --cov-report=xml --cov-report=html --junitxml=junit.xml — 282 passed, 61% total coverage
  • .venv/bin/python -m compileall -q handlers tests — passed
  • git diff --check — passed
  • scoped secret and forbidden-path diff scan — passed

Risk and rollback

Risk is low: the change only transitions matching pending approvals to the existing invalidated state. It does not change the database schema, public API, configuration, dependencies, authentication, permissions, or delivery logic. A narrow concurrency case where an edit arrives before approval creation remains outside this patch. Roll back by reverting commit 05cd471.

Prepared with automated assistance by EQ for AliZakaee.

@AliZakaee
AliZakaee merged commit b799065 into main Aug 11, 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