~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH aerc] notmuch: fix disappearing messages

Details
Message ID
<20240413222812.31292-2-julio.bacel@gmail.com>
DKIM signature
pass
Download raw message
Patch: +4 -1
The current implementation assumes that 'root[0].FirstChild' is nil, but
this is not always the case. Instead of overwriting the FirstChild,
detect and link the messages to the LastChild of root[0].

Fixes: 672b4edca7af2303cfcb1d69a676556d12476b5f
Fixes: https://lists.sr.ht/~rjarry/aerc-devel/%3C20240305231305.44287-4-julio.bacel%40gmail.com%3E
Signed-off-by: Julio B <julio.bacel@gmail.com>
---
 worker/notmuch/lib/database.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go
index 7216274a..9a8a9a60 100644
--- a/worker/notmuch/lib/database.go
+++ b/worker/notmuch/lib/database.go
@@ -139,7 +139,10 @@ func (db *DB) ThreadsFromQuery(ctx context.Context, q string, entireThread bool)
			root := db.makeThread(nil, &tlm, entireThread)
			if len(root) > 1 {
				root[0].Dummy = true
				root[0].FirstChild = root[0].NextSibling
				fc := &(root[0].FirstChild)
				for ; *fc != nil; fc = &((*fc).NextSibling) {
				}
				*fc = root[0].NextSibling
				root[0].NextSibling.PrevSibling = nil
				root[0].NextSibling = nil
				for i := 1; i < len(root); i++ {
-- 
2.44.0

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D0JCN7WKBSWO.1U5R4PSACGTBU@fra01>
In-Reply-To
<20240413222812.31292-2-julio.bacel@gmail.com> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 2m1s

[notmuch: fix disappearing messages][0] from [Julio B][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/50995
[1]: julio.bacel@gmail.com

✓ #1195126 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1195126
✓ #1195125 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1195125
Details
Message ID
<D0JQ2E7Q3AB6.2RBPFBJ4VOUL@sindominio.net>
In-Reply-To
<20240413222812.31292-2-julio.bacel@gmail.com> (view parent)
DKIM signature
pass
Download raw message
This indeed improves over the previous situation, but I worry that we may be
inducing obscure bugs that might be very hard to detect. I don't have a
solution, either.

Tested-By: inwit <inwit@sindominio.net>

Applied: [PATCH aerc] notmuch: fix disappearing messages

Details
Message ID
<171308706695.168822.2970370518864060239@ringo>
In-Reply-To
<20240413222812.31292-2-julio.bacel@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Julio B <julio.bacel@gmail.com> wrote:
> The current implementation assumes that 'root[0].FirstChild' is nil, but
> this is not always the case. Instead of overwriting the FirstChild,
> detect and link the messages to the LastChild of root[0].
>
> Fixes: 672b4edca7af2303cfcb1d69a676556d12476b5f
> Fixes: https://lists.sr.ht/~rjarry/aerc-devel/%3C20240305231305.44287-4-julio.bacel%40gmail.com%3E
> Signed-off-by: Julio B <julio.bacel@gmail.com>
> ---

Acked-by: Robin Jarry <robin@jarry.cc>

Applied with cleanup of Fixes trailer, thanks.

To git@git.sr.ht:~rjarry/aerc
   805a29aef932..0a1af14fd916  master -> master
Reply to thread Export thread (mbox)