Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Remove Deleted Subscribers from topic #5187

Merged

Conversation

djabarovgeorge
Copy link
Contributor

What change does this PR introduce?

Subscribers can be added in topic using subscriberId.
Subscriber can be deleted later using API or SDK, however a user manually also has to delete them from every topic they where apart of.

Why was this change needed?

If subscriber is deleted, it is still part of topic
Currently user had to call API to first check if subscriber is part of any topic then remove that subscriber from topic.

Definition of Done

  • Novu should automatically handle this usecase
  • The migration script to remove not existing subscribers from the topics

Copy link

linear bot commented Feb 13, 2024

Copy link

netlify bot commented Feb 13, 2024

Deploy Preview for dev-web-novu failed.

Name Link
🔨 Latest commit 8c7a0ff
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/65cb4acd59a8b5000875802d

Copy link
Contributor

@LetItRock LetItRock left a comment

Choose a reason for hiding this comment

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

you rock George! ⭐

Comment on lines +40 to +44
await this.topicSubscribersRepository.delete({
_environmentId: subscriber._environmentId,
_organizationId: subscriber._organizationId,
externalSubscriberId: subscriber.subscriberId,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

wow, that was easy peasy :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

easy peasy but we postponed the async matter here, but imo we definitely should start the discussion in order to support possible long processing into an async service like an external queue.
REF https://linear.app/novu/issue/NV-3230/auto-remove-deleted-subscribers-from-topic#comment-13955c84

@djabarovgeorge djabarovgeorge merged commit 85c41f0 into next Feb 13, 2024
23 of 27 checks passed
@djabarovgeorge djabarovgeorge deleted the nv-3230-1-auto-remove-deleted-subscribers-from-topic branch February 13, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants