X-Envelope-From: notmuch-bounces@notmuchmail.org  Fri Aug 14 12:15:20 2026
Return-Path: <notmuch-bounces@notmuchmail.org>
X-Original-To: nmbug@yantan.tethera.net
Delivered-To: nmbug@yantan.tethera.net
Received: from yantan.tethera.net (localhost [127.0.0.1])
	by mail.notmuchmail.org (Postfix) with ESMTP id 8D4555F87D;
	Fri, 14 Aug 2026 12:15:20 +0000 (UTC)
Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1])
	by mail.notmuchmail.org (Postfix) with ESMTPS id B23455F875
	for <notmuch@notmuchmail.org>; Fri, 14 Aug 2026 12:15:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net;
 i=@tethera.net; q=dns/txt; s=2024; t=1786709715; h=from : to : cc :
 subject : date : message-id : in-reply-to : references : mime-version
 : content-transfer-encoding : from;
 bh=2ye3AnGip+pa8YbeWNGtn/BTLlDtXjOQ7H6FOhromC4=;
 b=heUSj3mujps0Y23ioOlU5oVGcYdSOjVVIkbay8/+xjehdImiVme5aGwY9DInEkFV/FLZa
 ze1sqyLLw1zE/aFIyKgjlqH1jK+eb4PTEsiNs3p+R8OlxjBvaKqnJwER0oeYWwHdODkYdcJ
 naq9mcw4tlCFJsT0tPSqj4hWP/SMpvFs5Hn3bHCzEmonuqoUAAkimjgbbpd+GxcU0J/xez3
 VC9jmsm5cqk0fysn7S+kVC/i78ZYLv5WMzObis1Of74pNOxqeysIbYk5Ndh6It8fnvXcLDr
 /iGX67vq/c8qf03c6yY7JXAi0MZ/+OhKhoi8I/grBs5sPo0+2O66Jro0n6KQ==
Received: from tethera.net (fctnnbsc38w-142-162-53-181.dhcp-dynamic.fibreop.nb.bellaliant.net [142.162.53.181])
	by phubs.tethera.net (Postfix) with ESMTPS id 6C1BD1800F7;
	Fri, 14 Aug 2026 09:15:14 -0300 (ADT)
Received: (nullmailer pid 599295 invoked by uid 1000);
	Fri, 14 Aug 2026 12:15:10 -0000
From: David Bremner <david@tethera.net>
To: Brian May <brian@linuxpenguins.xyz>, notmuch@notmuchmail.org
Subject: [PATCH] test/new: extend (and break) reference loop test
Date: Fri, 14 Aug 2026 09:15:05 -0300
Message-ID: <20260814121505.599282-1-david@tethera.net>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <87mrvbj37j.fsf@linuxpenguins.xyz>
References: <87mrvbj37j.fsf@linuxpenguins.xyz>
MIME-Version: 1.0
Message-ID-Hash: FKNCZ2VXQPY5APOYDSTDRGWZCL57E5A2
X-Message-ID-Hash: FKNCZ2VXQPY5APOYDSTDRGWZCL57E5A2
X-MailFrom: bremner@tethera.net
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.3
Precedence: list
List-Id: "Use and development of the notmuch mail system." <notmuch.notmuchmail.org>
List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
List-Owner: <mailto:notmuch-owner@notmuchmail.org>
List-Post: <mailto:notmuch@notmuchmail.org>
List-Subscribe: <mailto:notmuch-join@notmuchmail.org>
List-Unsubscribe: <mailto:notmuch-leave@notmuchmail.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Brian May [1] reported a problem showing a message that claims to be a
reply to itself. The added message attempts to duplicate the issue
described there. Although the updated test is nominally a test of
notmuch new, it actually illustrates a bug in notmuch show.

[1]: id:87mrvbj37j.fsf@linuxpenguins.xyz
---
 test/T050-new.sh                 | 2 ++
 test/corpora/broken/loop/loop-00 | 9 +++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 test/corpora/broken/loop/loop-00

diff --git a/test/T050-new.sh b/test/T050-new.sh
index 52888be2..5f1352fd 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -462,11 +462,13 @@ test_begin_subtest "reference loop does not crash"
 test_expect_code 0 "notmuch show --format=json id:mid-loop-12@example.org id:mid-loop-21@example.org > OUTPUT"
 
 test_begin_subtest "reference loop ordered by date"
+test_subtest_known_broken
 threadid=$(notmuch search --output=threads id:mid-loop-12@example.org)
 notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT
 cat <<EOF > EXPECTED
 Date: Thu, 16 Jun 2016 22:14:41 -0400
 Date: Fri, 17 Jun 2016 22:14:41 -0400
+Date: Thu, 16 Jun 2018 22:14:41 -0400
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
diff --git a/test/corpora/broken/loop/loop-00 b/test/corpora/broken/loop/loop-00
new file mode 100644
index 00000000..8ce01cbd
--- /dev/null
+++ b/test/corpora/broken/loop/loop-00
@@ -0,0 +1,9 @@
+From: Alice <alice@example.org>
+To: Daniel <daniel@example.org>
+Subject: self reference is best reference
+Message-ID: <mid-loop-00@example.org>
+In-Reply-To: <mid-loop-00@example.org>
+References: <mid-loop-12@example.org>
+Date: Thu, 16 Jun 2018 22:14:41 -0400
+
+This message is in reply to itself
-- 
2.53.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org
