]> Sergey Matveev's repositories - public-inbox.git/commitdiff
V2Writeable.pm: Ensure that a found message number is in the msgmap
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 1 Aug 2018 16:43:43 +0000 (11:43 -0500)
committerEric Wong <e@80x24.org>
Fri, 3 Aug 2018 20:04:29 +0000 (20:04 +0000)
The lookup to see if a num has already been assigned to a message
happens in a temporary copy of message map.  It is possible that the
number has been removed from the current message map.  The
unindex/reindex after a history rewrite triggered by a purge should be
one such case.  Therefore add the number to the msgmap in case it is
not currently present.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
lib/PublicInbox/V2Writable.pm

index 92d2672c78c478f886a3bd7d5f9cb8c238f3456b..4dd14331a78f0b46eeadce951e388e47794be3b9 100644 (file)
@@ -676,6 +676,7 @@ sub reindex_oid {
                if (defined $n && $n > $num) {
                        $mid0 = $mid;
                        $num = $n;
+                       $self->{mm}->mid_set($num, $mid0);
                }
        }
        if (!defined($mid0) && $regen && !$del) {