incubator-ponymail icon indicating copy to clipboard operation
incubator-ponymail copied to clipboard

In single-thread view, nesting is at most two

Open jbapple opened this issue 6 years ago • 4 comments

Some time in the last few months, single-thread view stopped nesting deeper than two, for me, whether logged in or not, on all browsers I use, including various Chromes.

Here is an example thread:

https://lists.apache.org/thread.html/04b9a8a156939adae1aa4cf2d4e3abd2137f541cbf92ade6d775dc06@%3Cdev.parquet.apache.org%3E

When viewing this thread in the multi-thread view https://lists.apache.org/[email protected], nesting works properly, showing many levels of depth by use of the colored bars on the left-hand side.

jbapple avatar Jul 15 '19 03:07 jbapple

Looks like a bug in the nesting algorithm. It makes the mistake of finding children that are not direct descendants and adding them as direct ones. This should be fixed by checking the references header, and only filing direct matches (where references has the original message-id as the last value) as descendants, then letting those kids get their own accordingly.

Humbedooh avatar Jul 15 '19 10:07 Humbedooh

pesudo-fix for thread.lua:

        local direct_ref = true -- direct reference or not?
        local xemid = pdoc['message-id'] -- exact email id or parent
        if doc.references and #doc.references >= #xemid and doc.references:sub(-#xemid) ~= xemid and doc['in-reply-to'] ~= xemid then -- if it has "references" but doesn't match exactly, disregard
            direct_ref = false
        end

Then in the iteration, we'd check if direct_ref is true or false, and only add/account for if true.

Humbedooh avatar Jul 15 '19 10:07 Humbedooh

Works OK for me, see attached screenshot of thread.html

ThreadMode

sebbASF avatar Jul 15 '19 10:07 sebbASF

^- It works okay because I asked for the above to be applied as a test. So the fix works. I'll hammer out a proper patch once I'm done ferrying to this island I'm going to :)

Humbedooh avatar Jul 15 '19 10:07 Humbedooh