]> Sergey Matveev's repositories - public-inbox.git/commit
www: fix ref cycle from threading w/ extindex
authorEric Wong <e@80x24.org>
Mon, 4 Oct 2021 00:07:17 +0000 (19:07 -0500)
committerEric Wong <e@80x24.org>
Mon, 4 Oct 2021 03:36:28 +0000 (03:36 +0000)
commitb28e74c9dc0acad164187f6f584f815df1bc6ec7
tree0b223e4f48d2a87ec87557a53fc2d6ba2ef9ee77
parentc2b4e6111a561095d5155402d6900dae09b704eb
www: fix ref cycle from threading w/ extindex

Unlike v1 inboxes (which don't accept duplicate Message-IDs at
all), and v2 inboxes (which generate a new Message-ID for
duplicates), extindex must accept duplicate Message-IDs as-is.

This was fine for storage, but prevented the reference-cycle
mechanism of our message threading display algorithm from working
reliably.  It could no longer delete the ->{parent} field from
clobbered entries in the %id_table.

So we now take into account reused Message-IDs and never clobber
entries in %id_table.  Instead, we mark reused Message-IDs as
"imposters" and special-case them by injecting them as children
after all other threading is complete.

This cycle was noticed using a pre-release of Devel::Mwrap::PSGI:
  https://80x24.org/mwrap-perl.git
lib/PublicInbox/SearchThread.pm
t/thread-cycle.t