[From nobody Tue Jul 28 20:34:35 2009
Date: Mon, 27 Jul 2009 20:44:28 -0700
From: Mark Sapiro &lt;mark@msapiro.net&gt;
To: , Tollef Fog Heen &lt;tfheen@debian.org&gt;
Subject: Re: Debian Mailman Patch 30_pipermail_threads.patch breaks threading
Message-ID: &lt;PC192200907272044280562ba22410e@msapiro&gt;
MIME-Version: 1.0

Mark Sapiro wrote:

&gt;The patch 30_pipermail_threads.patch for bug #167758
&gt;&lt;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=167758&gt; causes
&gt;improper threading in pipermail archives.
&gt;
&gt;For example, the post with subject &quot;Twisted Trial&quot; at
&gt;&lt;http://twistedmatrix.com/pipermail/twisted-python/2009-June/thread.html#19859&gt;
&gt;is indented below the previous post even though it did not reference
&gt;that post in any way.
&gt;
&gt;Also, on the same index page, many posts are indented more than the
&gt;proper number of levels.
&gt;
&gt;This can also be seen at
&gt;&lt;http://twistedmatrix.com/pipermail/glyph-discuss/2009-May/thread.html&gt;
&gt;where the only two posts are indented to the 'next' level even though
&gt;there are no posts at the 'higher' level.
&gt;
&gt;See &lt;http://allmydata.org/pipermail/tahoe-dev/2009-July/thread.html&gt;
&gt;for another example of an improperly indented index.
&gt;
&gt;I confirmed that 30_pipermail_threads.patch causes this by downloading
&gt;&lt;http://allmydata.org/pipermail/tahoe-dev/2009-July.txt&gt; and building
&gt;an archive from it with Mailman's bin/arch. The threading in the
&gt;resulting index looked correct. I then applied
&gt;30_pipermail_threads.patch and built the archive again with bin/arch
&gt;and the result was the incorrectly indented index.
&gt;
&gt;I do see the problem in the original bug report, and in my test with a
&gt;simple 4-message input the patch does partially correct it, but even
&gt;there the subsequent messages are excessively indented.
&gt;
&gt;When I get a chance, I'll try to come up with a proper fix.


I understand why the patch causes excessive indentation. The
indentation level is determined by the number of hyphens ('-') in the
threadKey. Thus when the patch does things like

-            myThreadKey = article.date + '-'
+            myThreadKey = article.date + '/' + article.msgid + '-'

and article.msgid contains one or more hyphens, the resultant key winds
up with too many hyphens and is thus indented too far.

One possible fix to the patch is to remove any hyphens from the msgid
or replace them with some other character before appending the msgid
to the time stamp.

Another possibility is to append article.sequence instead of
article.msgid. This should still be unique and won't contain hyphens.

I'll do some more testing with this.

-- 
Mark Sapiro &lt;mark@msapiro.net&gt;        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



]