MBOX-Line: From arnt at gulbrandsen.priv.no  Fri May  9 14:06:14 2008
To: imap-protocol@u.washington.edu
From: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Date: Fri Jun  8 12:34:41 2018
Subject: [Imap-protocol] Optimistic incremental THREAD=REFERENCES
In-Reply-To: <1210364641.9518.397.camel@hurina>
References: <1210364641.9518.397.camel@hurina>
Message-ID: <C4+/sgL3fH13VZgTRBl1nA.md5@lochnagar.oryx.com>

I wrote code do to the same thing, and found another corner case. If one 
or more early message(s) is/are deleted from the mailbox, then it can 
be (and very seldom is) the case that a thread is split.

Consider this four-message thread:
     1 is the start.
     2 has an In-Reply-To pointing to 1.
     3 has an In-Reply-To pointing to 1
     4 has an IRT pointing to 2

If you thread this incrementally, you learn that this is one thread.

If messages 1 and 2 are deleted and another message arrives
     5 has an IRT pointing to 3
then your incremental algorithm may still have enough information to tie 
messages 3, 4 and 5 together in one thread. A non-incremental T=R 
doesn't have that information, and will make two threads.

The subject-joining rule magnifies this. Personally I didn't imnplement 
the subject-joining bit.

Arnt

