Skip to content

Add email-bounce suppression and complaint-handling tests for src/services/notifications/bounceStore.ts #678

Description

@1nonlypiece

📌 Description

src/services/notifications/bounceStore.ts and the email provider handle bounces
and retries, but there is no test asserting the suppression contract: that an
address with a hard bounce is suppressed from further sends, that a soft bounce
is retried up to a cap then suppressed, and that a complaint immediately
suppresses. Without this, the system could keep mailing a poisoned address and
harm deliverability.

Goal: prove the bounce/complaint suppression rules so future sends to a
suppressed address are blocked.

🎯 Requirements and Context

  • A hard bounce records suppression; a subsequent send to that address is skipped
    with a typed reason.
  • A soft bounce retries up to the configured cap, then suppresses.
  • A spam complaint suppresses immediately regardless of bounce history.
  • Suppression is queryable so the notification pipeline can short-circuit.

🛠️ Suggested Execution

1. Create a branch

git checkout -b test/email-bounce-suppression

2. Implement changes

  • Add src/tests/notifications.bounceStore.test.ts driving bounce/complaint
    events through the store and provider.

3. Test and commit

  • Run bun test src/tests/notifications.bounceStore.test.ts.
  • Edge cases: hard bounce, soft-bounce cap, complaint, send short-circuit.

Example commit message

test: email bounce and complaint suppression contract tests

✅ Guidelines

  • Minimum 95% coverage of the bounce-store paths.
  • Document the suppression state machine.
  • Timeframe: 96 hours.

🏷️ Labels

type-testing · area-backend · MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN

💬 Community & Support

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaignMAYBE REWARDEDEligible for GrantFox rewardOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programarea-backendBackend / API worktype-testingTests and test coverage

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions