Skip to content

test(subscriptions): add duplicate subscription regression test - #558

Open
coderolisa wants to merge 1 commit into
Core-Foundry:mainfrom
coderolisa:feat/duplicate-subscription-prevention
Open

test(subscriptions): add duplicate subscription regression test#558
coderolisa wants to merge 1 commit into
Core-Foundry:mainfrom
coderolisa:feat/duplicate-subscription-prevention

Conversation

@coderolisa

Copy link
Copy Markdown

closes #373

ntroduce SubscriptionService with duplicate detection to prevent users from subscribing multiple times to the same notification channel.

Changes:

  • Add subscription types with typed error codes
  • Implement SubscriptionService with fingerprint-based duplicate detection
  • Add 17 unit tests covering duplicate prevention, input validation, subscription lifecycle, and edge cases

Core duplicate prevention logic:

  • Uses userId:channel fingerprint for uniqueness
  • Returns existing subscription with DUPLICATE_SUBSCRIPTION error
  • Preserves original subscription data unchanged
  • Allows re-subscription after explicit unsubscribe

All new tests pass. Existing behavior unchanged.
Contributes toward notification channel subscription management.

Introduce SubscriptionService with duplicate detection to prevent
users from subscribing multiple times to the same notification channel.

Changes:
- Add subscription types with typed error codes
- Implement SubscriptionService with fingerprint-based duplicate detection
- Add 17 unit tests covering duplicate prevention, input validation,
  subscription lifecycle, and edge cases

Core duplicate prevention logic:
- Uses userId:channel fingerprint for uniqueness
- Returns existing subscription with DUPLICATE_SUBSCRIPTION error
- Preserves original subscription data unchanged
- Allows re-subscription after explicit unsubscribe

All new tests pass. Existing behavior unchanged.
Contributes toward notification channel subscription management.
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@coderolisa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Prevent Duplicate Subscriptions

1 participant