Skip to:
Content

Opened 2 years ago

Closed 22 months ago

Last modified 22 months ago

#3971 closed defect (bug) (fixed)

Private messaging sends to multiple users automatically

Reported by: minminloveislonely Owned by: DJPaul
Milestone: 1.5.6 Priority: normal
Severity: normal Version: 1.5.3
Component: Messaging Keywords: reporter-feedback
Cc: minmin@…

Description

When users send private messages to another user, the messages go to multiple users automatically and randomly. The messages were supposed to be between 2 users only, but they go to 3 users and the 3rd user is automatically sent messages to randomly.

Attachments (3)

buddypress_private_message_compose.jpg (21.9 KB) - added by minminloveislonely 2 years ago.
buddypress private messaging compose screen - sent to one person
buddypress_private_message_after_sent.jpg (18.7 KB) - added by minminloveislonely 2 years ago.
buddypress private messaging after sent - one recipient becomes two
Picture_32.png (81.4 KB) - added by shanebp 2 years ago.
listing three people in the conversation when there are only two

Download all attachments as: .zip

Change History (34)

comment:1 r-a-y2 years ago

  • Keywords reporter-feedback added
  • Severity changed from critical to normal

If you added multiple recipients in the private message and if people reply to that message, then each recipient will be sent the message.

Is this what you mean, if so, this is by design.

If you want to send individual private messages, then only add one recipient in the "To" field.

comment:2 johnjamesjacoby2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I'm not able to reproduce this. Closing as 'worksforme' pending any new information.

minminloveislonely2 years ago

buddypress private messaging compose screen - sent to one person

minminloveislonely2 years ago

buddypress private messaging after sent - one recipient becomes two

comment:3 follow-up: minminloveislonely2 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Please see attachment. It's not working. I disabled caching plugin to try - the same result. It'

comment:4 DJPaul2 years ago

Oh, that might be #3938. If it is, looks like I didn't check against branch. Oops.

comment:5 boonebgorges2 years ago

  • Milestone set to 1.5.5

comment:6 in reply to: ↑ 3 Mamaduka2 years ago

Replying to minminloveislonely:

Please see attachment. It's not working. I disabled caching plugin to try - the same result. It'

Can't reproduce error too.

comment:7 DJPaul2 years ago

  • Milestone changed from 1.5.5 to 1.5.6

comment:8 shanebp2 years ago

We are having a similar issue on an install of 1.5.3

User report:
'So in my inbox, it's showing my own username as an extra recipient in a message from one other user. IOW it's listing three people in the conversation when there are only two.'

See attached screenshot - Picture_32.png.

Last edited 2 years ago by shanebp (previous) (diff)

shanebp2 years ago

listing three people in the conversation when there are only two

comment:9 DJPaul2 years ago

  • Owner set to DJPaul
  • Status changed from reopened to assigned

comment:10 djpaul2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [5969]) Fix display of duplicate recipients listed in private messages for 1.5 branch. Fixes #3938 and #3971.

comment:11 slprof2 years ago

This is still a problem for me. I made the change but no difference. I'm using the latest version of BP and 3.3.1 WP. I have deactivated some plugins but I don't want to disrupt my site by continuing to send random PMs out. Maybe I can get some insight as to where to look for some problems.

Thanks.

comment:12 boonebgorges2 years ago

This is still a problem for me.

I'm afraid that it won't be possible for the team to fix the issue until (a) it can be verified as a problem with BP itself, and (b) precise steps can be provided to reproduce the issue. It's going to be difficult to accomplish both of these without deactivating potentially disruptive plugins.

Have you noticed any pattern to the stray messages? Are the only occurring in the case of certain kinds of senders? Certain recipients? Certain kinds of message content? Is the PM itself "random", or is it the extra recipient who is "random"? Is there a pattern to who gets added to the recipient lists? Look carefully at the message IDs and user IDs to see if there may be a confusion there. More broadly speaking: as much detail as you can provide to deduce a pattern. (There *has* to be a pattern, if this is actually a bug.)

comment:13 slprof2 years ago

Thanks for the quick response. You guys are doing some fantastic work here. Where is the donation bucket?

I am attaching a screenshot of a message. The recipients are showing differently than the other two image attachments with this ticket. Mine is (random)NAME,empty space, (recipient)NAME

http://cyprischat.org/images/multi-recipients-pm.png

I turned off every plugin but Buddypress, Cubepoints, and WPMS Login and I still get the problem. It could be that I have done some core file edits and simply screwed something up. I just thought I would share what I am experiencing in hopes the gods of fixem will come through for me. Cheers.

comment:14 boonebgorges2 years ago

Thanks for the additional info.

  • Have you verified that the "random" user listed here (Noax) can actually view the message when logging in? That is - is this a bug with the message being sent to the wrong people, or a bug in the code that displays recipients? (Because of the blank space, I suspect the latter, which is at least a less serious issue.)
  • If you've modified core files, please restore them to their original content, and see if this bug clears itself up.
  • Please give it a test with the bp-default theme, in order to verify that this is not a theme-related problem.

comment:15 slprof22 months ago

I'm not sure why, possibly something to do with caching, but it works now. Thanks.

comment:16 minminloveislonely22 months ago

  • Resolution fixed deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened
  • Version changed from 1.5.3 to 1.5.6

I'm sorry. The bug is not fixed. Please continue to work on it. Thanks!

comment:17 boonebgorges22 months ago

  • Milestone changed from 1.5.6 to Future Release

The bug is not fixed. Please continue to work on it.

We would be happy to continue to work on it, but we need to have your help. None of the BP developers have been able to reproduce the problem as originally stated. Please reread the discussion above, especially my questions/comments about themes, plugins, and caching, and provide as much information as you possibly can about any patterns you see, and about how we might reproduce the issue on our own setups.

comment:18 minminloveislonely22 months ago

  • Type changed from defect (bug) to enhancement
  • Version changed from 1.5.6 to 1.6-beta

Hi Boone,

Thanks very much. After reading your previous messages again and checking the installation, I find it's getting much better, because as you assumed, the message isn't sent to the person other than the intended recipient, even though it's displayed like that. The rest is not important, but I would like to answer you those questions anyway:

  1. Are the only occurring in the case of certain kinds of senders? Certain recipients? Certain kinds of message content? Is the PM itself "random", or is it the extra recipient who is "random"? Is there a pattern to who gets added to the recipient lists?

Not only occurs to a certain kinds of senders, or recipients, or messages, and only the extra recipient is random. The rest is not random.

  1. Have you verified that the "random" user listed here (Noax) can actually view the message when logging in? That is - is this a bug with the message being sent to the wrong people, or a bug in the code that displays recipients? (Because of the blank space, I suspect the latter, which is at least a less serious issue.)

The random user doesn't receive the message, so it only displays the random recipient, which is a less serious issue, right.

You're a smart guy, Boone. I'm well impressed by your patience, attention to detail, and analytical thinking.

comment:19 DJPaul22 months ago

  • Version changed from 1.6-beta to 1.5.3

The version field is for the earliest version of WordPress that the problem exists on (or, often, the version which you encountered the problem on). Please don't change it.

comment:20 follow-up: boonebgorges22 months ago

  • Severity changed from major to normal
  • Type changed from enhancement to defect (bug)

minminloveislonely - Do you have direct access to the database for the site where you're seeing this problem? I'd like you to do a bit of debugging, if you can.

Find an instance where this problem is happening. Look in the database table wp_bp_messages_messages to find out what the thread ID is. Using the thread subject, the following query should do it:

SELECT thread_id FROM wp_bp_messages_messages WHERE subject = 'PUT YOUR SUBJECT HERE';

Remember to put your subject in there :)

Once you have a thread_id, see what the database says about the recipients:

SELECT * FROM wp_bp_messages_recipients WHERE thread_id = 'PUT THE THREAD ID HERE';

You *should* only see the *correct* recipients listed here (under user_id) - not the "random" user. If you can verify this, it'll narrow things down, and I can give you some more instructions for debugging.

comment:21 in reply to: ↑ 20 minminloveislonely22 months ago

Replying to boonebgorges:

You *should* only see the *correct* recipients listed here (under user_id) - not the "random" user. If you can verify this, it'll narrow things down, and I can give you some more instructions for debugging.

Yes, I only see the correct recipients ;-)

comment:22 follow-up: boonebgorges22 months ago

Good - that confirms that it's definitely a display issue.

Now for the real digging :) In the plugin files, open buddypress/bp-messages/bp-messages-template.php. Look for the function bp_thread_has_messages(), which should start around line 774: https://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-messages/bp-messages-template.php#L716 Put a new line right above the final line in the plugin, so that it looks like this:

$thread_template = new BP_Messages_Thread_Template( $thread_id, $order );
print_r( $thread_template->thread->recipients );
return $thread_template->has_messages();

(the print_r() line is the new one). Then open one of the problematic threads in the browser, and take note of what's printed on the screen. You might find it a bit easier to read if you turn that print_r() line into the following:

echo '<pre>'; print_r( $thread_template->thread->recipients ); echo '</pre>';

Who is in the list? Are you seeing the "random" member, in addition to the legitimate recipients? Depending on your answer to this, we can do another level of digging.

comment:23 in reply to: ↑ 22 minminloveislonely22 months ago

  • Version changed from 1.5.3 to 1.5.6

Replying to boonebgorges:

Good - that confirms that it's definitely a display issue.

Now for the real digging :) In the plugin files, open buddypress/bp-messages/bp-messages-template.php. Look for the function bp_thread_has_messages(), which should start around line 774: https://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-messages/bp-messages-template.php#L716 Put a new line right above the final line in the plugin, so that it looks like this:

$thread_template = new BP_Messages_Thread_Template( $thread_id, $order );
print_r( $thread_template->thread->recipients );
return $thread_template->has_messages();

(the print_r() line is the new one). Then open one of the problematic threads in the browser, and take note of what's printed on the screen. You might find it a bit easier to read if you turn that print_r() line into the following:

echo '<pre>'; print_r( $thread_template->thread->recipients ); echo '</pre>';

Who is in the list? Are you seeing the "random" member, in addition to the legitimate recipients? Depending on your answer to this, we can do another level of digging.

Yes, I see the "random" member in addition to the legitimate recipients :-)

comment:24 follow-up: boonebgorges22 months ago

  • Version changed from 1.5.6 to 1.5.3

OK. Next, in buddypress/bp-messages/bp-messages-classes.php, there are two methods called get_recipients(). You want the first one (in class BP_Messages_Thread): https://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-messages/bp-messages-classes.php#L53

Right after line 56 (the one beginning $results =), put the following:

echo '<pre>';
print_r( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
echo '<br /><br />';
print_r( $results );
echo '</pre>';

Then, two questions. (1) Do you also see the random member in this list? (Probably yes.) (2) Can you paste the SQL statement here? Should look something like SELECT * FROM wp_bp_messages_recipients WHERE thread_id = 2

comment:25 in reply to: ↑ 24 minminloveislonely22 months ago

  • Cc minmin@… added

Replying to boonebgorges:

OK. Next, in buddypress/bp-messages/bp-messages-classes.php, there are two methods called get_recipients(). You want the first one (in class BP_Messages_Thread): https://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-messages/bp-messages-classes.php#L53

Right after line 56 (the one beginning $results =), put the following:

echo '<pre>';
print_r( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
echo '<br /><br />';
print_r( $results );
echo '</pre>';

Then, two questions. (1) Do you also see the random member in this list? (Probably yes.) (2) Can you paste the SQL statement here? Should look something like SELECT * FROM wp_bp_messages_recipients WHERE thread_id = 2

Yes.

SELECT * FROM wp_bp_messages_recipients WHERE thread_id = 392

Array
(

[0] => stdClass Object

(

[id] => 801
[user_id] => 183
[thread_id] => 392
[unread_count] => 1
[sender_only] => 0
[is_deleted] => 0

)

[1] => stdClass Object

(

[id] => 1176
[user_id] => 1
[thread_id] => 392
[unread_count] => 0
[sender_only] => 0
[is_deleted] => 0

)

[2] => stdClass Object

(

[id] => 1177
[user_id] => 109
[thread_id] => 392
[unread_count] => 0
[sender_only] => 1
[is_deleted] => 0

)

)

comment:26 follow-up: boonebgorges22 months ago

Thanks for the additional details. Which of these users is the random one? Is it the first one, user_id 183? What's funny about this list is that, based on the id, the first recipient-item was generated long before the second and third (which are consecutive, 1176 and 1177).

comment:27 in reply to: ↑ 26 minminloveislonely22 months ago

Replying to boonebgorges:

Thanks for the additional details. Which of these users is the random one? Is it the first one, user_id 183? What's funny about this list is that, based on the id, the first recipient-item was generated long before the second and third (which are consecutive, 1176 and 1177).

Yes, the first one is the random one. Yes, the first recipient-item was generated long before and it's usually the one that was deleted (so the id was available for use)

Bon courage, detective.

comment:28 follow-up: boonebgorges22 months ago

it's usually the one that was deleted (so the id was available for use)

So, there's a pattern of messages having been deleted? You didn't mention that when I asked about patterns :)

Are you able to reproduce the bug regularly? Can you give *as many details as possible* about how to do it?

The problem appears to be that the delete process for the original thread didn't run completely. But it's going to be difficult to troubleshoot that unless either you or I can regularly and predictably reproduce the issue.

comment:29 in reply to: ↑ 28 minminloveislonely22 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Replying to boonebgorges:

it's usually the one that was deleted (so the id was available for use)

So, there's a pattern of messages having been deleted? You didn't mention that when I asked about patterns :)

Are you able to reproduce the bug regularly? Can you give *as many details as possible* about how to do it?

The problem appears to be that the delete process for the original thread didn't run completely. But it's going to be difficult to troubleshoot that unless either you or I can regularly and predictably reproduce the issue.

Congrats. Problem solved :-) My bad. Here it is:

I didn't notice the pattern of messages having been deleted until you mentioned recipient-item was generated long before. Then you mentioned the problem appeared to be that the delete process for the original thread didn't run completely.

THEN this reminds of the crime I did in phpMyAdmin. I deleted a bunch of unread welcome messages in Prefix_bp_messages_messages only :-) Now I deleted them from prefix_bp_messages_recipients as well.

Bingo.

I think it only happens to gals like me.

Thanks for your time, Boone.

comment:30 boonebgorges22 months ago

I think it only happens to gals like me.

Sometimes happens to guys like me too :)

Thanks for your diligence!

comment:31 DJPaul22 months ago

  • Milestone changed from Future Release to 1.5.6
Note: See TracTickets for help on using tickets.