Support #17241
closedpost not emailed
Added by Marilyn Weber almost 2 years ago. Updated over 1 year ago.
0%
Manual test of duplicate topics
Description
Jason Nielson writes:
"I sent out a post this morning to several commons groups and it did post, but I don't think any email was pushed through. This was the subject line, around 8 or 9 am: "Event on Dec 1st, 5:30 PM, 5307: Exhaustion and Labor in the Digital Age"
Sent to the MA in DH and MS in Data Vis Groups, among others."
and
"I sent it around 8:30 am, give or take. It's for an event on Dec 1, so it's not urgent. Worst case I can re-post, which is no big deal. I verified with Matt and Filipa (dh advising fellow) and they didn't get the email. But it posted to the forum.
It had an attachment and a registration link and a few other links. Maybe it got filtered because of the links?"
Related issues
Updated by Boone Gorges over 1 year ago
- Assignee set to Raymond Hoh
Ray, could you please take a look to see if anything jumps out?
Updated by Raymond Hoh over 1 year ago
- Category name set to Email Notifications
- Status changed from New to Resolved
- Target version set to 2.0.12
This appears to be the same problem as #13457. See https://redmine.gc.cuny.edu/issues/13457#note-12 for more details. Looks like the sleep( 5 )
fix I put on production awhile ago was removed.
I've just committed my fix to ensure this doesn't happen again. See https://github.com/cuny-academic-commons/cac/commit/5ec0d9c1925870783ab9c47f81e111ac8fac172b. I've pushed this fix to production as well. As mentioned in the older report, it might be worthwhile to think about reducing the sleep value to something like 2 seconds or to use wp_schedule_single_event()
instead.
Updated by Raymond Hoh over 1 year ago
- Related to Bug #13457: Forum post not sending notifications added
Updated by Raymond Hoh over 1 year ago
Marilyn, I forgot to mention that Jason should try to repost the event to the group to see if the emails will be sent out.
Updated by Marilyn Weber over 1 year ago
Jason reports:
I resent this to the MS Program in Data Analysis and Vis group at 12:58 pm today. It posted, but no email notification went out again.
I also marked the post to go to other groups: the MA in DH group, CUNY GC ITP Program, CUNY Technology Group, Digital Humanities Initiative, GC Digital Initiatives, and Futures Initiatives.
I know it did not post to the MA in DH group--I'm not sure about the others.
Thanks,
Jason
Updated by Raymond Hoh over 1 year ago
- Status changed from Resolved to Assigned
I can confirm that no email notifications were sent for Jason's 12:58pm topic. Here's the topic in question: https://commons.gc.cuny.edu/groups/ms-program-in-data-analysis-and-visualization/forum/topic/event-on-dec-1st-530-pm-5307-exhaustion-and-labor-in-the-digital-age-5/.
Boone, the corresponding activity ID for that topic is 877612. The group email debug log lists this:
[21-Nov-2022 17:58:57] Beginning batch of immediate notifications for 876612. [21-Nov-2022 17:58:57] Finished sending immediate notifications for 876612. A total of 0 notifications were sent over all batches.
I believe the 0 notifications
is due to what bp-multiple-forum-post
does to short-circuit the GES send out here: https://github.com/cuny-academic-commons/bp-multiple-forum-post/blob/685bc9d91b118bb8516c6e2f690339f8c1623c57/includes/email-notifications.php#L78. However, GES will always trigger an immediate queue batch so that's why we are seeing this zero log entry; I've just opened a PR to address this: https://github.com/boonebgorges/buddypress-group-email-subscription/pull/229.
- https://commons.gc.cuny.edu/groups/cuny-gc-itp-program/forum/topic/event-on-dec-1st-530-pm-5307-exhaustion-and-labor-in-the-digital-age-6/
- https://commons.gc.cuny.edu/groups/cuny-technology-group/forum/topic/event-on-dec-1st-530-pm-5307-exhaustion-and-labor-in-the-digital-age-7/
This should have created two, corresponding activity items, but these activity items do not exist. (This is similar to what we were discussing in #13457.) So I spent the day looking at this issue and ended up refactoring bp-multiple-forum-post
to use wp_schedule_single_event()
in place of the WP_Async_Task
library: https://github.com/cuny-academic-commons/bp-multiple-forum-post/commit/e449afa0874a5103c50a7b38ff45b059c318fd4e.
The commit creates two single cron events: one for creating the duplicate forum topics and the other, to create the duplicate activity items. Both events are scheduled one minute into the future. This should ensure that the duplicate activity item is created. From my tests locally, this is working decently. I also attempted a small test on cdev, but the emails did not send out (not sure if this is something related to cdev or whatever). However, the duplicate activity did get recorded into the other group, so maybe it is worth trying on production, but I would really like another set of eyes to look at this before doing so. Would appreciate your thoughts, Boone.
Updated by Boone Gorges over 1 year ago
- Status changed from Assigned to Staged for Production Release
- Deployment actions updated (diff)
Thanks for digging in here, Ray.
I also attempted a small test on cdev, but the emails did not send out (not sure if this is something related to cdev or whatever).
There's some safeguards on cdev to ensure that emails are only sent out to addresses belonging to members of group 465 (the CAC team group) https://github.com/cuny-academic-commons/cac/blob/34f70e226c41f8e77cf0e7084279088b57fecad0/wp-content/mu-plugins/cac-functions.php#L1331 It's possible that this is why the emails didn't go out.
The change to scheduled tasks seems good to me. The one thing I'll note is that I've had problems when passing $args
to scheduled events while using Cavalcade, as you do at https://github.com/cuny-academic-commons/bp-multiple-forum-post/commit/e449afa0874a5103c50a7b38ff45b059c318fd4e#diff-7b8e5a1effd4addd7c6f3f7e927845925aa49322bb760c653883dd01bea850a0R126. It's very (very) possible this is due to user error, but I wanted to flag it as something that should be tested.
I'll run some tests after today's deployment (around 10-10:30am Central) and I'll ask you to do some additional testing when you're available later in the day.
Updated by Marilyn Weber over 1 year ago
Jason writes:
It's something about this specific post that seems to be the problem, I think: perhaps it gets read as duplicate or spam, or maybe because I tried to post to 5-6 groups? I don't know.
I just posted a new message to the MA and MS program groups a bit ago about courses and it went through fine (and sent an email out).
Updated by Boone Gorges over 1 year ago
Ray, I did some light testing post-release. Here's what I found:
1. Posted in group A, crossposting to group B
2. One minute later, forum topic was created in B
3. Email notifications were sent about B, with footer notice that the post was also posted in A
4. Activity items were present in A and B
5. Did not receive an email notification about A, but I think this is by design, as my test users were members of both groups (see item 3)
So, I think we are in good shape, but perhaps you can test before marking resolved.
Updated by Raymond Hoh over 1 year ago
I did one quick test with two groups, Boone, and I received email notifications, but the emails arrived really fast. It was definitely not two minutes. Maybe the server time and the MySQL time is off by a little bit. I'll look into this after the dev call.
Updated by Raymond Hoh over 1 year ago
Ignore my previous post, I think the bp-multiple-forum-post
change was reverted when I was testing prior.
I just added the change on production briefly so I could test the new change and I was able to receive the group emails three minutes after posting. So it looks like it is working.
I have reverted the change for the time being though. If we want to test this when Jason is available, let either Boone or myself know.
Updated by Boone Gorges over 1 year ago
Sorry if I accidentally overwrote something during the deployment process. Maybe something needed to be cherry-picked from the master branch?
I think we should go ahead and implement the change so that Jason can test. Ray, can you go ahead and make the change on production?
Updated by Raymond Hoh over 1 year ago
Sorry if I accidentally overwrote something during the deployment process. Maybe something needed to be cherry-picked from the master branch?
No need to apologize, Boone. I did not commit the bp-multiple-forum-post
change to 2.0.x
branch for the 2.0.12 release. I've just committed the change -- https://github.com/cuny-academic-commons/cac/commit/c97443fef258d789853f8a9c7dfe25a0a0f158f2 -- and this is now live on production.
Marilyn, can you ask Jason to test the multiple topic functionality again? Please tell Jason that there will be a delay of between 2-3 minutes before group email notifications will start to send out.
Updated by Boone Gorges over 1 year ago
- Status changed from Staged for Production Release to Resolved
Closing due to inactivity. Marilyn, please let us know if the user gets back in touch.
Updated by Raymond Hoh 5 months ago
- Related to Bug #19971: Expected Group Forum Functionality added