user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: meta@public-inbox.org
Subject: Re: BUG?: The UI shows an "In-Reply-To" value different than the actual value
Date: Tue, 20 Nov 2018 07:45:53 +0000	[thread overview]
Message-ID: <20181120074553.72ayiqorwdsvdfoi@dcvr> (raw)
In-Reply-To: <87tvkczqk8.fsf@evledraar.gmail.com>

Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> (I'm not on-list, please keep me CC'd)

Yep, it's expected and strongly encouraged behavior here to
reply-all :) Centralization is the enemy, and I don't expect
many people are subscribed to this list.

> Maybe I'm being evil, but when I talk about another E-Mail I add it to
> the "References" header. Reading
> https://tools.ietf.org/html/rfc5322#section-3.6.4 this may be more evil
> than I thought at first.

This part of RFC 5322?

      Note: Some implementations parse the "References:" field to
      display the "thread of the discussion".  These implementations
      assume that each new message is a reply to a single parent and
      hence that they can walk backwards through the "References:" field
      to find the parent of each message listed there.  Therefore,
      trying to form a "References:" field for a reply that has multiple
      parents is discouraged; how to do so is not defined in this
      document.

Yes, public-inbox does treat the order of References as significant.

> Anyway, if you look at
> https://public-inbox.org/git/87va4szr2q.fsf@evledraar.gmail.com/ you can
> see one such E-Mail. The UI shows:
> 
>     In-Reply-To: <874lcd1bub.fsf@evledraar.gmail.com>
> 
> But as the "raw" view shows these are the actual headers:
> 
>     References: <9e293b1b-1845-1772-409b-031c0bf4d17b@gmail.com>
>             <871s7g29zy.fsf@evledraar.gmail.com>
>             <6f0ff2e3-4019-1dcc-f61a-cd0919b9a247@gmail.com>
>             <874lcd1bub.fsf@evledraar.gmail.com>
>     In-reply-to: <6f0ff2e3-4019-1dcc-f61a-cd0919b9a247@gmail.com>
> 
> I'd expect the web UI to show the value of the header in its primary
> view.

Yes, I understand how that can be disconcerting...

Perhaps the View.pm code can actually use the In-Reply-To header
if it exists, but that may throw off the thread skeleton code
and Xapian index.


When I was working on this, I found References: more consistent
and easier-to-parse than In-Reply-To; as the latter could
contain random human-readable phrases.  Thus the code favors
using the References header for threading.

lib/PublicInbox/MID.pm has this, currently:

	# last References should be IRT, but some mail clients do things
	# out of order, so trust IRT over References iff IRT exists
	sub references ($) {
		my ($hdr) = @_;
		my @mids;
		foreach my $f (qw(References In-Reply-To)) {
			my @v = $hdr->header_raw($f);
			foreach my $v (@v) {
				push(@mids, ($v =~ /<([^>]+)>/sg));
			}
		}
		uniq_mids(\@mids);
	}

So, it appears the comment and code don't match (it's been a
while :x).  Maybe this is needed, too?

diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index cd56f27..a775fdc 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -79,7 +79,9 @@ ($)
 			push(@mids, ($v =~ /<([^>]+)>/sg));
 		}
 	}
+	@mids = reverse(@mids);
 	uniq_mids(\@mids);
+	[ reverse(@mids) ];
 }
 
 sub uniq_mids ($) {


Note: untested.

  reply	other threads:[~2018-11-20  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 21:48 BUG?: The UI shows an "In-Reply-To" value different than the actual value Ævar Arnfjörð Bjarmason
2018-11-20  7:45 ` Eric Wong [this message]
2018-11-20 12:43   ` Leah Neukirchen

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://public-inbox.org/README

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

  git send-email \
    --in-reply-to=20181120074553.72ayiqorwdsvdfoi@dcvr \
    --to=e@80x24.org \
    --cc=avarab@gmail.com \
    --cc=meta@public-inbox.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://80x24.org/public-inbox.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).