unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Gregor Zattler <telegraph@gmx.net>, notmuch@notmuchmail.org
Subject: Re: bug: wrong order of messages in notmuch-show
Date: Sun, 29 Jul 2018 17:47:45 +0800	[thread overview]
Message-ID: <871sbmpe4e.fsf@tethera.net> (raw)
In-Reply-To: <87fu05p2iu.fsf@len.workgroup>

Gregor Zattler <telegraph@gmx.net> writes:

> Hi David, dear notmuch developers,
> * Gregor Zattler <telegraph@gmx.net> [2018-07-01; 23:27]:
>> This happens often to me with emails from a ticket system which I
>> cannot disclose.  In this kind of technical threads order is
>> necessary to understand current status of affairs.
>
> I finally isolated two such threads, anonymized them and indexed
> them.  tar'ed and compressed the maildir is small enough to attach,
> therefore I attached it.
>
>
> With the first thread (Ticket 33712) notmuch shows the "-->"
> marked email last in thread, instead (as according to date sent)
> before position marked "+++":

I find it helpful to look at these things in tree-view. 

     July 09  Gregor Zattler        ┬►xxxxxxx-xxxxxxxxx-server xxxxxxxxxxxx               (inbox)
     July 09  via RT                ╰┬►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33712] AutoReply: xxxxxxx-xxxxxxxxx-server xxxxxxxxxxxx (inbox replied)
     July 09  Gregor Zattler         ╰┬► ...                                              (inbox replied)
     July 10  Gregor Zattler          ├─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33712] xxxxxxx-xxxxxxxxx-server xxxxxxxxxxxx (inbox)
  Tue. 20:03  Gregor Zattler          ├─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33712] AutoReply: xxxxxxx-xxxxxxxxx-server xxxxxxxxxxxx (inbox)
     July 09  via RT                  ╰─►[support.xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxx.de #33712] xxxxxxx-xxxxxxxxx-server xxxxxxxxxxxx (inbox)

The place notmuch is not doing as nice a job as you would like is in
ordering the children of your July 9 message. I think this is because it
is added into the tree in the second pass. It ends up in this situation
because its In-Reply-To field points to a non-existent (in the local
database).  In the previous version of threading, I'm pretty sure it
would have been a root message, which might have looked a bit better
with respect to dates, but would have been just as confusing.

[enter thinking out loud mode]

I agree there is still room for improvement here.  Looking at the code,
it seems like it might make sense to order the children by date in
_notmuch_message_add_reply. Currently this uses a generic linked list
insert at tail, which is O(1). It would be more expensive to insert by
date, but it would depend how many replies to a given message there are.

  reply	other threads:[~2018-07-29  9:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 21:27 bug: wrong order of messages in notmuch-show Gregor Zattler
2018-07-01 21:59 ` Amin Bandali
2018-07-02  0:23 ` David Bremner
2018-07-02  8:06   ` Gregor Zattler
2018-07-08 12:24     ` David Bremner
2018-07-08 12:24       ` [PATCH 1/2] test: start threading test corpus David Bremner
2018-07-08 12:24       ` [PATCH 2/2] test: add known broken test for "ghost roots" David Bremner
2018-07-27  7:21 ` bug: wrong order of messages in notmuch-show Gregor Zattler
2018-07-29  9:47   ` David Bremner [this message]
2018-07-29 13:57     ` Gregor Zattler
2018-09-08 10:35 ` David Bremner
2018-09-08 20:42   ` Gregor Zattler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sbmpe4e.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=telegraph@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).