diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-02-16 02:59:11 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-02-16 02:59:11 +0000 |
commit | fc62e40e4e3d00a00377ba26aeca010880158caa (patch) | |
tree | f14cc38f1bb2804294565fe6cc3175f21b89428f /lib/PublicInbox/SearchIdx.pm | |
parent | 777df7d3f08de47c5b905a6ec8e7271fb2c1df9d (diff) | |
download | public-inbox-fc62e40e4e3d00a00377ba26aeca010880158caa.tar.gz |
In general, they are, but there's no way for or general purpose mail server to enforce that. This is a step in allowing us to handle more corner cases which existing lists throw at us.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index fa5057fd..265403a3 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -366,12 +366,14 @@ sub remove_message { $mid = mid_clean($mid); eval { - $doc_id = $self->find_unique_doc_id('XMID' . $mid); - if (defined $doc_id) { - $db->delete_document($doc_id); - } else { + my ($head, $tail) = $self->find_doc_ids('XMID' . $mid); + if ($head->equal($tail)) { warn "cannot remove non-existent <$mid>\n"; } + for (; $head != $tail; $head->inc) { + my $docid = $head->get_docid; + $db->delete_document($docid); + } }; if ($@) { |