unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: notmuch@notmuchmail.org
Subject: Re: Possible some threads are not complete due to bug?
Date: Sun, 13 Sep 2015 08:19:45 +0200	[thread overview]
Message-ID: <20150913061945.GD18353@chitra.no-ip.org> (raw)
In-Reply-To: <CAJhTkNh7_hXDLsAGyD7nwkXV4ca6ymkLtFG945USvfqK4ZJEdQ@mail.gmail.com>

Hi,

You should include a reference to the original message, not everyone
will remember the thread.

  id:20150614082258.GD17381@chitra.no-ip.org or
  <http://mid.gmane.org/20150614082258.GD17381@chitra.no-ip.org>

On Sun, Sep 13, 2015 at 12:03:20AM -0400, Xu Wang wrote:
> 
> Sometimes I need to do:
> 
> $ notmuch search --output=threads "id:MYMSGID"
> thread:000000000000a125
> $ notmuch search --output=messages "thread:000000000000a125"

Looking at the script again, I see I assumed a message will belong to a
single thread.  You can remove that assumption by applying the following
change.

-----8<--------------------8<-----
diff -u nm-ack nm-ack
--- nm-ack	2015-06-15 01:30:40.327556510 +0200
+++ nm-ack	2015-09-13 07:58:30.734096931 +0200
@@ -10,8 +10,9 @@
 # debug
 # set -o xtrace
 
-declare query="$1" thread=$(notmuch search --output=threads -- "$1")
-declare -a msgs=$(notmuch search --output=messages -- "$thread") responses
+declare query="$1"
+declare -a thread=$(notmuch search --output=threads -- "$1")
+declare -a msgs=$(notmuch search --output=messages -- "${thread[@]}") responses
 
 function strip_mid() {
     sed -e 's/ \+//g' -e 's/<\([^ <>]\+\)>/\1/g'
----->8-------------------->8-----

> In theory, this should output the message that responded to message ID
> "MYMSGID". Sometimes it works. But sometimes it does not work. That
> is, there exists an email where I am sure (I checked the raw email)
> that there is a header
> In-Reply-To: <MYMSGID>
> but that email does not show when I do the two commands above.
> Indeed, that mail belongs to a different thread ID.
> 
> I am just curious if the above is due to:
> 
> 1. My missing of understanding of how notmuch deals with threads
> 2. A bug or missing feature in notmuch causes some threads to be incomplete

Interesting issue.  I can think of a case, say a message is cross-posted
to multiple lists, it might then give you more than one thread ids.  Is
this the case for your message?  If you are up for it, look in
lib/thread.cc.  I think the relevant methods are:
_resolve_thread_relationships and _notmuch_thread_create, but I could be
wrong.  I'm not familiar with the notmuch source.

As I recall, you are using mutt-kz; does <entire-thread> work from
mutt-kz?  I would expect that to fail too.  It gets the thread id like
this:

  id = notmuch_message_get_thread_id(msg);

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

  reply	other threads:[~2015-09-13  6:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-13  4:03 Possible some threads are not complete due to bug? Xu Wang
2015-09-13  6:19 ` Suvayu Ali [this message]
2015-09-13 15:10   ` Xu Wang
2015-09-19 15:45 ` [PATCH] test: add sanity tests for threading David Bremner
2015-11-23 12:54   ` David Bremner
2015-09-19 16:02 ` Possible some threads are not complete due to bug? David Bremner
2015-09-20 14:33   ` Xu Wang
2015-09-23 22:44     ` David Bremner
2015-09-24  0:55       ` Xu Wang
2015-10-04 10:57         ` David Bremner
2015-10-05  3:52           ` Xu Wang

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=20150913061945.GD18353@chitra.no-ip.org \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /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).