Project

General

Profile

Actions

Bug #11160

closed

Return of duplicate email notifactions for blog comments

Added by Gina Cherry about 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Email Notifications
Target version:
Start date:
2019-02-25
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Please refer to Bug #10800


Related issues

Related to CUNY Academic Commons - Bug #10800: Duplicate email notifications on blog commentsResolvedRaymond Hoh2018-12-07

Actions
Related to CUNY Academic Commons - Bug #11313: Overly aggressive spam filtersResolvedRaymond Hoh2019-04-11

Actions
Actions #1

Updated by Boone Gorges about 5 years ago

  • Assignee set to Raymond Hoh

Gina, can you please share links to the content that triggered the duplicate notifications?

Actions #2

Updated by Gina Cherry about 5 years ago

This has happened with the last several blog comments. Here is the most recent example: https://cetls.bmcc.cuny.edu/blog/2019/01/25/race-racism-teaching/

All of the blog comments from the last few months have been flagged as spam, which I need to release and then approve since comments on this blog are moderated. It would be great if we could also figure out why this is happening. Since I don’t receive email notifications about spam, it means I have to remember to check for comments every day.

Actions #3

Updated by Boone Gorges about 5 years ago

  • Target version set to 1.14.8

Thanks for these additional details, Gina. The spam issue sounds suspicious to me. It suggests that there may be a couple related issues: 1. Unspamming a blog comment double-triggers the notification process, and 2. Spam filters are being overly aggressive for your site. We'll investigate.

Regarding email notifications about spam, the site appears to be configured to send an email to whenever a comment is sent to spam. https://bmcccetls.commons.gc.cuny.edu/wp-admin/options-discussion.php Are you checking the proper inbox? Perhaps those notifications are being sent to spam for some reason?

Actions #4

Updated by Gina Cherry about 5 years ago

Thanks, Boone. I'm fairly sure that the spam comment notifications are not being sent to email spam. I have not seen these notifications in the email spam for either the CETLS account or my personal account. There have been blog comments in the past that were not sent to spam. In those cases, I received notifications at both the CETLS email and my personal email.

Actions #5

Updated by Raymond Hoh about 5 years ago

  • Related to Bug #10800: Duplicate email notifications on blog comments added
Actions #6

Updated by Raymond Hoh about 5 years ago

  • Category name set to Email Notifications
  • Status changed from New to Resolved

I outlined the problem here: https://redmine.gc.cuny.edu/issues/10800#note-8

To summarize, for anonymous blog comments, there are two email actions being fired:

// First save by BP Include Non-Member Comments
do_action('wp_ajax_dim-comment'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wp_ajax_dim_comment, wp_set_comment_status, do_action('wp_set_comment_status'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, bp_blogs_record_nonmember_comment_approved, bp_blogs_record_nonmember_comment, bp_blogs_record_activity, bp_activity_add, BP_Activity_Activity->save, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, ass_group_notification_activity

// Second save by BP Group Email Subscription
do_action('wp_ajax_dim-comment'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wp_ajax_dim_comment, wp_set_comment_status, wp_transition_comment_status, do_action('transition_comment_status'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, bp_activity_transition_post_type_comment_status, BP_Activity_Activity->save, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, ass_group_notification_activity

To address the problem, we let the first save through, but then remove the second save from happening.

(Code reference - https://github.com/cuny-academic-commons/cac/commit/7c725e2948b71fed62592004bd7db30c8894bdf9)

My previous attempt at fixing this by blocking duplicate queued items from being recorded from sending appears to only address group digests and not immediate email sendouts.

I have deployed this as a hotfix on production. Gina, please reopen and let me know if you are still experiencing duplicate email notifications after unspamming a comment.

Actions #7

Updated by Raymond Hoh about 5 years ago

  • Related to Bug #11313: Overly aggressive spam filters added
Actions

Also available in: Atom PDF