-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[NV-1759] fix(api): fixed remove subscriber from topic functionality #2903
Conversation
@@ -135,4 +135,90 @@ describe('Remove subscribers to topic - /topics/:topicKey/subscribers/removal (P | |||
expect(getResponseTopic.name).to.eql(topicName); | |||
expect(getResponseTopic.subscribers).to.eql([]); | |||
}); | |||
|
|||
it('should remove subscriber from only one topic', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests to cover the issue
@@ -42,7 +42,7 @@ export class TopicSubscribersRepository extends BaseRepository<EnforceEnvironmen | |||
await this.delete({ | |||
_environmentId, | |||
_organizationId, | |||
key: topicKey, | |||
topicKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
NV-1759 🐛 Bug Report: Removing a subscriber from a topic removes them from all subscribed topics
📜 DescriptionIf a user is subscribed to a bunch of topics and we remove them from a single topic using 👟 Reproduction steps
👍 Expected behaviorRemoving should only remove the subscriber from the defined topic. 👎 Actual Behavior with ScreenshotsSubscriber is removed from every topic they're subscribed to. 📃 Provide any additional context for the Bug.Discord: https://ptb.discord.com/channels/895029566685462578/1078569121861603389 👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to submit PR?None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌟
@@ -42,7 +42,7 @@ export class TopicSubscribersRepository extends BaseRepository<EnforceEnvironmen | |||
await this.delete({ | |||
_environmentId, | |||
_organizationId, | |||
key: topicKey, | |||
topicKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
What change does this PR introduce?
Fixes the issue: #2902
When the subscriber is added to multiple topics the
POST /topics/:topic_key/subscribers/removal
endpoint removes him from all the topics, but should only remove from the exact topic by the:topic_key
.Why was this change needed?
Fixes the above issue.
Other information (Screenshots)