From feb4a75affbe5f940116dc4f6bcc5ddb52a110b4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 May 2017 10:49:00 +0000 Subject: searchidx: fix ghost root vivification Due to the asynchronous nature of SMTP, it is possible for the root message of a thread (with no References/In-Reply-To) to arrive last in a series. We must preserve the thread_id of the ghost message in this case, as we do when vivifiying non-root ghosts. Otherwise, this causes threads to be broken when the root arrives last. --- lib/PublicInbox/SearchIdx.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/SearchIdx.pm') diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 8a529c66..e4e3c81b 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -330,7 +330,7 @@ sub link_message { merge_threads($self, $tid, $ptid); } } else { - $tid = $self->next_thread_id; + $tid = defined $old_tid ? $old_tid : $self->next_thread_id; } $doc->add_term(xpfx('thread') . $tid); } -- cgit v1.2.3-24-ge0c7