diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-09-28 20:56:59 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-09-28 20:56:59 +0300 |
commit | 33300fe0f8890da1d3d6fec1ea5450e10714c32d (patch) | |
tree | f0db1dc5aeaf2383f34d083a7fb1621a2187a224 /lib/Listener | |
parent | e014f4c358497e25fb2de74e673f12e0cc379a70 (diff) |
Fix flattening of threads for database update
There were some obvious flaws with threading, like some messages would
not group. But there was no pattern so far. I expected the threading
algorithm to be the problem, but it was on a different level: when we
flatten the thread trees into lists of messages to udpate the thread
root ID in the database.
The logic should flatten each of the trees. And all of those messages
that are of the same thread get the same root thread ID set. So far the
theory, but the code passed down the parent message's ID as thread root
ID, hence the (linear) threads broke into multiple.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Listener')
-rw-r--r-- | lib/Listener/AccountSynchronizedThreadUpdaterListener.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Listener/AccountSynchronizedThreadUpdaterListener.php b/lib/Listener/AccountSynchronizedThreadUpdaterListener.php index f681f7d89..d23b890fa 100644 --- a/lib/Listener/AccountSynchronizedThreadUpdaterListener.php +++ b/lib/Listener/AccountSynchronizedThreadUpdaterListener.php @@ -95,7 +95,7 @@ class AccountSynchronizedThreadUpdaterListener implements IEventListener { yield from $this->flattenThreads( $thread->getChildren(), - $message === null ? null : $message->getId() + $threadId ?? ($message === null ? null : $message->getId()) ); } } |