Skip to content

fix(email): prevent ambiguous delivery blind re-dispatch #37

Description

@kjxcodez

Problem

VALID_DELIVERY_TRANSITIONS in �pps/api/src/repositories/email-delivery/email-delivery.repository.ts allows transitions from AMBIGUOUS -> SENDING and FAILED -> SENDING. This permits
eserveDelivery() to reclaim an ambiguous delivery and re-dispatch an outbound message without verifying provider-side acceptance, violating the invariant: 'Never blindly resend when provider acceptance is uncertain.'

Solution

  1. Remove unsafe direct AMBIGUOUS -> SENDING transition without reconciliation verification.
  2. Require reconciliation confirmation before re-dispatching ambiguous deliveries.
  3. Add focused tests proving blind re-dispatches are prevented.

Dependencies

Depends on #32.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions