Per #2960360: Add a method to remove a user from a thread, there is an issue with adding (removing) users to a private message thread. It can lead to duplicate threads.

If you remove a user from thread 2, it now becomes identical to thread 1, which will create a collision/bugs. If/when the user were to go to the 'create new mesage' page, the system would not know which thread to add messages to.

In #3154558: 1116 Too many tables; MariaDB can only use 61 tables in a join, there is some means to make sure you retrieve the correct message thread. It works in most cases. Unless you have a private message block loaded on a page without any context.

We need to handle that later case, were we have insufficient context to know which thread to load.

Comments

heddn created an issue. See original summary.

artem_sylchuk’s picture

I've been thinking of this for a while.
Not sure what is being tried to achieve forcing the uniquness of the thread per members.
I think the most of the messengers (Skype, facebook messenger, etc) allow that cause otherwise you'll not be able to edit thread members:

1. If you are able to add members to existing trheads - you'll be able to do AB + C OR BC + A and both will be ABC.
2. If you are able to remove members from existing threads - you'll be able to do ABC - C making it identical to already existing AB
(Both cases are described in comments here: https://www.drupal.org/project/private_message/issues/2960360

I don't see any limitations from the DB side for allowing having the multiple threads for the same members. I use patch for that on the project with 5+ millions of private messages and it works quite well.
I'll try reviewing the code to find where exactly it expects the threads to be unique for the given members
I assume it is only this one:

Unless you have a private message block loaded on a page without any context.

Then probably that context should be required.

artem_sylchuk’s picture