diff options
author | Eric Wong <e@80x24.org> | 2018-04-25 08:52:48 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-04-25 08:53:02 +0000 |
commit | ec2df4c3b80104a0bf15b0d917d82264bbf9b50e (patch) | |
tree | e934c76e91cfc64b4879cffe57a2112691414360 /lib/PublicInbox/SearchThread.pm | |
parent | 77704e711685d119fde9d1737029e102c76c9a14 (diff) | |
download | public-inbox-ec2df4c3b80104a0bf15b0d917d82264bbf9b50e.tar.gz |
In retrospect, the loop prevention done by our indexer is not always sufficient since it can have an improperly sorted or incomplete References headers. This bug was triggered multiple bracketed Message-IDs in an In-Reply-To: header (not References) where the Message-IDs were in non-chronological order when somebody tried to reply to different leafs of a thread with a single message. So we must check for descendents before blindly trying to use the last one. Fixes: c6a8fdf71e2c336f ("thread: last Reference always wins")
Diffstat (limited to 'lib/PublicInbox/SearchThread.pm')
-rw-r--r-- | lib/PublicInbox/SearchThread.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index 1d250b46..450a06f4 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -76,7 +76,9 @@ sub _add_message ($$) { # C. Set the parent of this message to be the last element in # References. - $prev->add_child($this) if defined $prev; + if (defined $prev && !$this->has_descendent($prev)) { # would loop + $prev->add_child($this); + } } package PublicInbox::SearchThread::Msg; |