From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F02A21F54E; Wed, 20 Jul 2022 22:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1658357828; bh=vOhKbft6BTSROAmbluu7cYv8XbCU4D2voNEnWbD+0ok=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p7SKQRAhblFAdrZ+bik8ol0mrtuk/1DOfUHCUHLi3xEvqfHAKdugYIQtmim5r8R3+ B+c7uKbSzEQh9wjg9a/ldtBMwaAArD7yIN0o7KjRwGZXLq0vpWmlq5QyUxlg3NMPwB UVM4y8xYfnrXcEdJRHWs20nLq2mVYjMm0uTPMG8E= Date: Wed, 20 Jul 2022 22:57:07 +0000 From: Eric Wong To: meta@public-inbox.org Cc: Rob Herring Subject: [PATCH] www: note "x=m" and "t=1" (mis)use for GET requests Message-ID: <20220720225707.M876218@dcvr> References: <20220629163033.GA14412@dcvr> <20220629172742.M978900@dcvr> <20220630085539.M324144@dcvr> <20220718234124.M213084@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220718234124.M213084@dcvr> List-Id: Eric Wong wrote: > Rob Herring wrote: > > Based on what the web interface presents, it sure seems like 't=1' is > > independent of the query. The results listed are only those that match > > the query and date range on the match. > > Actually, for the HTML results, t=1 is ignored right now... > it's only for mboxrd downloads (via POST) at the moment... > That should be clarified/changed. > > > For example, this query returns 3 matches: > > > > https://lore.kernel.org/all/?x=m&t=1&q=((dfn%3Adrivers+OR+dfn%3Aarch+OR+dfn%3ADocumentation%2F*+OR+dfn%3Ainclude+OR+dfn%3Ascripts)+AND+f%3Arobh%40kernel.org+AND+rt%3A1641934905..)+AND+dt%3A20220630203819.. > > > > If I change 'dt' to 1 day earlier, I get 1 more match: > > > > https://lore.kernel.org/all/?x=m&t=1&q=((dfn%3Adrivers+OR+dfn%3Aarch+OR+dfn%3ADocumentation%2F*+OR+dfn%3Ainclude+OR+dfn%3Ascripts)+AND+f%3Arobh%40kernel.org+AND+rt%3A1641934905..)+AND+dt%3A20220629203819.. > > > > That 4th match has a reply after 6/30, but the 1st query will not get > > the reply. This is all reproducible without lei involved at all. > > Right. t=1 only expands threads if they're linked via > References/In-Reply-To or (loosely) via matching Subjects. --------8<-------- Subject: [PATCH] www: note "x=m" and "t=1" (mis)use for GET requests We require "x=m" (requests for mboxes) to be POST requests to avoid unnecessary traffic from crawlers. "t=1" only collapses threads in the summary view, which isn't normally accessible from
elements. This also fixes the missing "[summary|nested]" element when "x=m" is used. --- lib/PublicInbox/SearchView.pm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index b1cdb480..b025ec96 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # # Displays search results for the web interface @@ -193,18 +193,24 @@ sub search_nav_top { my $x = $q->{x}; my $pfx = "\t\t\t"; - if ($x eq '') { - my $t = $q->qs_html(x => 't'); - $rv .= qq{summary|nested} - } elsif ($x eq 't') { + if ($x eq 't') { my $s = $q->qs_html(x => ''); $rv .= qq{summary|nested}; $pfx = "thread overview below | "; + } else { + my $t = $q->qs_html(x => 't'); + $rv .= qq{summary|nested} } my $A = $q->qs_html(x => 'A', r => undef); - $rv .= qq{|Atom feed]}; + $rv .= qq{|Atom feed]\n}; + $rv .= <{t}; +*** "t=1" collapses threads in summary, "full threads" requires mbox.gz *** +EOM + $rv .= <{ibx}->isrch->has_threadid) { - $rv .= qq{\n${pfx}download mbox.gz: } . + $rv .= qq{${pfx}download mbox.gz: } . # we set name=z w/o using it since it seems required for # lynx (but works fine for w3m). qq{}; } else { # BOFH needs to --reindex - $rv .= qq{\n${pfx}download: } . + $rv .= qq{${pfx}download: } . qq{} } $rv .= qq{
};