Skip to content

Feat/issue 192#210

Merged
jeroenrinzema merged 7 commits intomainfrom
feat/issue-192
Apr 11, 2026
Merged

Feat/issue 192#210
jeroenrinzema merged 7 commits intomainfrom
feat/issue-192

Conversation

@RickieeeDev
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an unsubscribe status lookup in the management subscriptions store and uses it in the campaigns send consumer to skip non-transactional sends for users who have unsubscribed from the campaign’s subscription.

Changes:

  • Add IsUserUnsubscribed to SubscriptionsStore (with sql.ErrNoRows handling).
  • Update campaign send consumer to skip sending when the user is unsubscribed (non-transactional campaigns only).
  • Add store-level tests covering IsUserUnsubscribed behavior across no-record/unsubscribe/resubscribe cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/store/management/subscriptions.go Adds IsUserUnsubscribed query helper for user+subscription unsubscribe state.
internal/store/management/subscriptions_test.go Adds unit test coverage for IsUserUnsubscribed across key state transitions.
internal/pubsub/consumer/campaigns.go Skips non-transactional campaign sends when the user is unsubscribed from the campaign’s subscription.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/pubsub/consumer/campaigns.go
Comment thread internal/store/management/subscriptions.go
@jeroenrinzema
Copy link
Copy Markdown
Contributor

@RickieeeDev could you please take a look at the failing lint and tests?

Switch user_subscription.state from integer to VARCHAR with a check
constraint. Update code to use 'unsubscribed' string instead of integer
constant. Simplify IsUserUnsubscribed logic.
@jeroenrinzema jeroenrinzema merged commit 439f130 into main Apr 11, 2026
6 checks passed
@jeroenrinzema jeroenrinzema deleted the feat/issue-192 branch April 11, 2026 20:32
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants