unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 3/9] test: add known broken tests for "ghost roots"
Date: Sat, 21 Jul 2018 08:37:40 +0900	[thread overview]
Message-ID: <20180720233746.2844-4-david@tethera.net> (raw)
In-Reply-To: <20180720233746.2844-1-david@tethera.net>

This documents the bug discussed at

     id:87efgmmysi.fsf@len.workgroup

The underlying issue is that the reply to a ghost (missing) message is
falsely classified as a root message in _resolve_thread_relationships.

The first test is simpler / more robust, but also easier to fool.
---
 test/T260-thread-order.sh                   | 27 +++++++++++++++++++++
 test/corpora/threading/ghost-root/fake-root |  2 +-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh
index fea61275..ce8636b9 100755
--- a/test/T260-thread-order.sh
+++ b/test/T260-thread-order.sh
@@ -75,4 +75,31 @@ $(for ((i = 0; i < $nthreads; i++)); do
 done
 test_expect_equal "$output" "$expected"
 
+add_email_corpus threading
+
+test_begin_subtest "reply to ghost"
+test_subtest_known_broken
+notmuch show --entire-thread=true id:000-real-root@example.org | grep ^Subject: | head -1  > OUTPUT
+cat <<EOF > EXPECTED
+Subject: root message
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "reply to ghost (tree view)"
+test_subtest_known_broken
+test_emacs '(notmuch-tree "tag:inbox")
+	    (notmuch-test-wait)
+	    (test-output)
+	    (delete-other-windows)'
+cat <<EOF > EXPECTED
+  2016-06-17  Alice                 ┬►root message                                        (inbox unread)
+  2016-06-18  Alice                 ╰┬►child message                                      (inbox unread)
+  2016-06-18  Alice                  ├┬►grand-child message                               (inbox unread)
+  2016-06-18  Alice                  │╰─►great grand-child message                        (inbox unread)
+  2016-06-18  Daniel                 ├─►grand-child message 2                             (inbox unread)
+  2016-06-17  Mallory                ╰─►fake root message                                 (inbox unread)
+End of search results.
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done
diff --git a/test/corpora/threading/ghost-root/fake-root b/test/corpora/threading/ghost-root/fake-root
index 102bb228..5be228fd 100644
--- a/test/corpora/threading/ghost-root/fake-root
+++ b/test/corpora/threading/ghost-root/fake-root
@@ -6,4 +6,4 @@ In-Reply-to: <nonexistent-message@example.org>
 References: <000-real-root@example.org> <001-child@example.org> <nonexistent-message@example.org>
 Date: Thu, 16 Jun 2016 22:14:41 -0400
 
-This message has no reply-to
+This message has a reply-to to a non-existent message
-- 
2.18.0

  parent reply	other threads:[~2018-07-20 23:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 23:37 v1: fix for threading of replies to ghost messages David Bremner
2018-07-20 23:37 ` [PATCH 1/9] util: add DEBUG_PRINTF, rename error_util.h -> debug_print.h David Bremner
2018-07-20 23:37 ` [PATCH 2/9] test: start threading test corpus David Bremner
2018-07-20 23:37 ` David Bremner [this message]
2018-07-20 23:37 ` [PATCH 4/9] lib: read reference terms into message struct David Bremner
2018-07-20 23:37 ` [PATCH 5/9] lib/thread: refactor in-reply-to test David Bremner
2018-07-20 23:37 ` [PATCH 6/9] lib: initial fix for "ghost replyto" David Bremner
2018-07-20 23:37 ` [PATCH 7/9] lib: calculate message depth in thread David Bremner
2018-07-20 23:37 ` [PATCH 8/9] lib/thread: rewrite _parent_or_toplevel to use depths David Bremner
2018-07-20 23:37 ` [PATCH 9/9] lib/thread: change _resolve_thread_relationships " David Bremner
2018-07-21 17:35 ` v1: fix for threading of replies to ghost messages Gregor Zattler
2018-07-23  8:41   ` David Bremner
2018-07-23 12:09     ` 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=20180720233746.2844-4-david@tethera.net \
    --to=david@tethera.net \
    --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).