Hi wpDiscuz team,
I found a bug in the subscription logic. I'm on one of the latest versions (7.6.72).
What happens
When a user subscribes through the box above the comments ("new follow-up comments" or "new replies to my comments"), any bell subscriptions they already have on that post are deleted. The more general subscription replaces the more specific one.
Steps to reproduce
- Post a comment with no subscription selected, then click the bell on it.
- Subscribe through the box above the comments, choosing "new follow-up comments", with the same email address.
- In wp-admin, the bell subscription (type
comment) has been replaced by apostsubscription. - Reply directly to the first comment from a different email address.
- The first user gets the generic "New Comment" email, not "New Reply On Your Comment".
If the order is reversed (box first, bell second), the bell survives. The result depends on the order of actions, which looks unintended.
Cause
From reading the source, addEmailNotification() in class.WpdiscuzDBManager.php calls deleteCommentNotifications() whenever the type is not comment. That runs:
DELETE FROM wc_comments_subscription
WHERE subscribtion_type != 'post' AND post_id = %d AND email = %s
This removes every subscription for that email on the post except post rows, including the bell (comment) rows.
Expected behavior
A broader subscription shouldn't remove a more specific one. Users who enabled the bell should still get "New Reply On Your Comment" for direct replies.
Suggested fix
Exclude comment rows from that delete, so only all_comment rows are replaced. If both a bell and a broad subscription then match one comment, sending only the most specific email would avoid duplicates, in the order bell, then "replies to my comments", then "follow-up comments".
Thanks for looking into this. I can provide more details if needed.

