The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
AI Assistant
Bell (per-comment) ...
 
Notifications
Clear all

Issue Bell (per-comment) subscriptions are deleted when a user subscribes via the box above the comments

4 Posts
2 Users
0 Reactions
286 Views
Posts: 15
Topic starter
Translate ▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@accelera)
Eminent Member
Joined: 4 months ago
[#11695]

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

  1. Post a comment with no subscription selected, then click the bell on it.
  2. Subscribe through the box above the comments, choosing "new follow-up comments", with the same email address.
  3. In wp-admin, the bell subscription (type comment) has been replaced by a post subscription.
  4. Reply directly to the first comment from a different email address.
  5. 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.


3 Replies
Asti
Posts: 8377
 Asti
Support
Translate ▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 9 years ago

Hi,

Thank you for the detailed explanation and for taking the time to investigate the subscription logic.

The current behavior is intentional. It is designed this way to prevent users from receiving duplicate or excessive email notifications when multiple subscription types overlap.

We appreciate your feedback and the suggested improvements. Thank you for your understanding!


Reply
Posts: 15
Topic starter
Translate ▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@accelera)
Eminent Member
Joined: 4 months ago

Hi Asti,

Thanks for the reply. I understand the goal is to avoid duplicate emails. My point is that the same goal can be reached when sending, by emailing the user once from their most specific subscription, instead of deleting the bell subscription they explicitly chose when they subscribe in the box.

Is that something you'd consider?


Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 9 years ago

Illustrious Member
Posts: 8377
Translate ▼
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@accelera

We're sorry, but at the moment, we don't have any plans to change the current functionality. The existing solution works well for the vast majority of wpDiscuz users, and we're not currently considering changes to this behavior.

Thank you for your understanding!


Reply