BuddyDev

Search

[Resolved] BuddyPress Group Activities Notifier has inconsistant notifications

  • Participant
    Level: Initiated
    Posts: 10
    Janette on #5467

    We are using this plugin and noticed that not all notifications are going out. I looked inside the
    bp_activity and bp_notifications tables and I think I’ve stumbled on the reason, but I have no idea
    how to fix it.

    There were 3 posts by the same author to a group this morning: group id = 151, the first two went out, one
    did not (32751). I searched in bp_notifications on one of the group members and found that the one post
    seems to have the wrong activity_id attached.

    bp_activity:
    id user_id component type item_id secondary_item_id date_recorded
    32749 48 groups activity_update 151 0 07/09/2016 12:36
    32750 48 groups activity_update 151 0 07/09/2016 12:44
    32751 48 groups activity_update 151 0 07/09/2016 12:50

    bp_notifications:

    id user_id item_id secondary_item_id component_name component_action date_notified
    12138 510 151 32712 localgroupnotifier group_local_notification_32712 2016-09-02 15:42:15 1
    12781 510 151 32749 localgroupnotifier group_local_notification_32749 2016-09-07 12:37:52 1
    13076 510 151 32750 localgroupnotifier group_local_notification_32750 2016-09-07 12:45:42 1

    Any help would be really appreciated!
    Janette

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #5468

    Hi Janette,
    Welcome to BuddyDev forums.

    I am sorry for the inconvenience.

    Can you please tell me which version of BuddyPress, WordPress(Is it multisite?) and the Group Activity Notifier plugin are you using?

    I am looking at it, any of the above information will help me to do it quickly.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Janette on #5470

    Hi Brajesh,

    It’s non-multisite WP 4.6.1, BP 2.6.2 and BuddyPress Group Activities Notifier 1.0.3.

    I should have sent that in the original post.

    Thanks,
    Janette

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #5471

    Hi Janette,
    Thank you for the prompt reply.
    No problem, appreciate the details. I will have an update in an hour.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #5472

    Hi Janette,
    My apologies for not asking it before. By going out the notification, do you mean the notification by email or just the notification on BuddyPress site(local notification).

    PS: Your data seems correct to me. The notifications entry get deleted on read.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Janette on #5474

    Hi Brajesh,

    That’s really interesting. I did not know they were deleted on read. Shouldn’t there be an entry for the last post? (activity id 32751)in bp_notification? User 510 has not logged in for 2 years, so she could not have read it. We are looking at emails as well, but I thought I’d better start at the creation of the notification.

    Thanks,
    Janette

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #5475

    Hi Janette,
    Thank you. I looked at it again and here is what happens, Please check and let me know if I am missing something or there is some difference you are observing

    1. When an activity update is created in the group, all members of the group are fetched and we create individual notifications for all these users. For each of these users, there goes an entry in the notifications table where

    item_id = The GroupId
    secondary_item_id = ID of the activity

    user_id = The User whom we should show the notification

    component = ‘localgroupnotifier’,
    component_action= ‘group_local_notification_’ . $activity_id,

    The notification is only deleted for the user if he/she clicks on the notification and reads the activity(On visiting single activity page).

    In normal cases, for each update,we will have multiple notification created, one for each member of the group.

    There are two cases where the php script timeout may affect us.
    a) If we have too many group members , say 5000 (which is very uncommon)
    b). Or there is some callback attached to ‘bp_group_activities_notify_members’ and the callback takes a lot of time.

    Can you please help me to understand if you think one of the above is happening?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Janette on #5480

    Hi Brajesh,

    I don’t think we have too many group members. About 300 is the biggest group. There is a action on that callback called ‘buddydev_mail_on_new_group_activity’ in the bp-custom.php. The ‘SMTP Mailing Queue’ plugin did not send any emails, so we went back to ‘WP Mail SMTP’.

    Thanks,
    Janette

  • Participant
    Level: Initiated
    Posts: 10
    Janette on #5481

    Hi Brajesh,

    I don’t think we have too many group members. About 300 is the biggest group. There is a action on that function called ‘buddydev_mail_on_new_group_activity’ in the bp-custom.php. The ‘SMTP Mailing Queue’ plugin did not send any emails, so we went back to ‘WP Mail SMTP’.

    Thanks,
    Janette

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #5482

    Hi Janette,
    thank you.
    that makes sense.

    At the moment the hook which is used to send email is called before creating the local notification.

    For now, can you please comment out the code from the bp-custom.php and then post and update and see if all users get notified. They should. Once it is happening,I will update the code and move the hook below local activity creation. That will allow us to make it work.

    The mailing without a queuing is going to be unreliable for large volume of emails.

    Please check with the hooked code disabled in bp-custom.php and let me know.We can proceed further then.

    Thank you for your patience.

    Regards
    Brajesh

The topic ‘ [Resolved] BuddyPress Group Activities Notifier has inconsistant notifications’ is closed to new replies.

This topic is: resolved