]> Sergey Matveev's repositories - public-inbox.git/commit
over: ensure old, merged {tid} is really gone
authorEric Wong <e@80x24.org>
Fri, 4 Dec 2020 12:09:29 +0000 (12:09 +0000)
committerEric Wong <e@80x24.org>
Sat, 5 Dec 2020 06:36:43 +0000 (06:36 +0000)
commit9356ec0cc5afc95a8fd398ddf898942ef0acdb74
tree50f9de9c82572894a1cfdda2951c02890597a312
parent82ffb3c183ac20e00effa8a5a7b664eda59672de
over: ensure old, merged {tid} is really gone

We must use the result of link_refs() since it can trigger
merge_threads() and invalidate $old_tid.  In case
merge_threads() isn't triggered, link_refs() will return
$old_tid anyways.

When rethreading and allocating new {tid}, we also must update
the row where the now-expired {tid} came from to ensure only the
new {tid} is seen when reindexing subsequent messages in
history.  Otherwise, every subsequently reindexed+rethreaded
message could end up getting a new {tid}.

Reported-by: Kyle Meyer <kyle@kyleam.com>
Link: https://public-inbox.org/meta/87360nlc44.fsf@kyleam.com/
MANIFEST
lib/PublicInbox/OverIdx.pm
t/thread-index-gap.t [new file with mode: 0644]