Authentication-Results: mail-b.sr.ht; dkim=pass header.d=timculverhouse.com header.i=@timculverhouse.com; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mail-b.sr.ht (Postfix) with ESMTPS id 2F39B11F053 for <~rjarry/aerc-devel@lists.sr.ht>; Sat, 20 Aug 2022 14:47:01 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 00F135C0160; Sat, 20 Aug 2022 10:47:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 20 Aug 2022 10:47:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= timculverhouse.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to; s=fm3; t=1661006820; x=1661093220; bh=FJ98nG0ga6pHqq19OMCaM80Ja d4NJ9L5HUX2OOVbksY=; b=OEoRxsjG1mK1sYHABOuvp2ubG9xRIlNwoBTc5QngX epsal2HLoECtwOlJRevsQyECZ7rVADoO0I9sg32QJ17Z9flS8UwzGIy7byYly+qJ 6S7pjn9PMYpAIOwsF8BaZMAWGjkxWBnQWJrS3IjKNVI/esBywzo5kLSWUybc00r8 2N4JWR6XEyzxINhncjIdajwoYva/cgCi7m8HjwXvjK+OvRI++N+0TomcknPhWqq9 JS/MM99qEG1vlW0Uo1W/3iZ00aGzcYmSjpHaW0DeuzcCOisDKu8241xCNX0qDkrR Gi8anCSYanAscf+23zDKZPtJh/H3PbL2kvsQtEvdPjMzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1661006820; x=1661093220; bh=F J98nG0ga6pHqq19OMCaM80Jad4NJ9L5HUX2OOVbksY=; b=0Hx2uk7A6sPBNrQwe cm4gM0zyu+3Y9XqJdys2pcc9GQpMnmgdTxB/uFp6A7YFmRws5bvsTndfKt2OIMUU ouOdSqcNu8q+etXYpUV1hAB3RfPFHXxtLTfcGkzJc69FSNEs7oyAGQjhaEjDbE6J 9cBMBPxihLSwQOs7Svh1+nxCil/0HztHWIuiFefvyRYcnJQxgBx6ULTh/NitOije BNuFsFZ6cF8yEhLmGuL/RUCL348Vcj8nNquY4T4Dm9HUHyf/V3cd1atHBtiZgKqe HRw2C2ajnStZiQlErNx7xpZClN8HckPem49gMMZ8dideevDKiCs2GNmdWKsTo4en Th2pA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeifedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepggfgtgffkffvuffhofhfjgesthhqredtredtjeenucfhrhhomhepfdfvihhm ucevuhhlvhgvrhhhohhushgvfdcuoehtihhmsehtihhmtghulhhvvghrhhhouhhsvgdrtg homheqnecuggftrfgrthhtvghrnhepleeugffgudeljeeludefffekgeehleeiuefhgeel heejveejjefhfeegheeufeeunecuffhomhgrihhnpehmvghsshgrghgvvhhivgifrdhgoh drihhtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep thhimhesthhimhgtuhhlvhgvrhhhohhushgvrdgtohhm X-ME-Proxy: Feedback-ID: i3ad947a1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 20 Aug 2022 10:47:00 -0400 (EDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 20 Aug 2022 09:46:59 -0500 Message-Id: To: "James Cook" , "Moritz Poldrack" , <~rjarry/aerc-devel@lists.sr.ht> Subject: Re: [PATCH aerc] Use IMAP PEEK and allow not marking messages read. From: "Tim Culverhouse" X-Mailer: aerc 0.10.0-179-g8a6cca3c03ee References: <20220820002218.43914-1-falsifian@falsifian.org> In-Reply-To: Thanks for the updates, James! Comments below: On Sat Aug 20, 2022 at 9:15 AM CDT, James Cook wrote: > I considered that that end then decided not to. > > Here's an expanded reasoning, mostly following the two points in my > previous email. > [...] > 1. Plumbing (point #2 in previous email): > Now I need to actually pass that "peek" parameter. Based on some quick > grepping, store.FetchFull is called three times and store.FetchBodyPart > four times. Only one of those seven calls is a function actually updated > by this patch (NewMessageStorView in lib/messageview.go). For example, > the pipe command uses it (to get the data to be piped?). I agree it's annoying, but I do think it's the right way to do it. More below. > 2. Having two mechanisms is clumsy and error-prone. Peek=3Dfalse is never > needed. > > Every time you view a message with aerc (before this patch), this line > gets called: > > store.Flag([]uint32{messageInfo.Uid}, models.SeenFlag, true, nil) > > This suffices to set the \Seen flag. I think that the right way to implement would be to move this piece to the backend. Since the backends behave different, the UI should tell the worker what it wants, and the worker should do it. If they all behaved the same, I'd argue it doesn't matter - but they don't, so we should allow each to operate as efficiently as possible. In this case, the UI wants to open an email and mark it as read. The worker can accomplish this in whatever way is most efficient for that worker. In other cases, the UI wants to fetch a message but not mark it as read. > To add to this: in most of those seven calls I think "peek" I mentioned > above, I think Peek should be fixed to true. The only one where setting > Peek to false makes some sense is NewMessageStoreView in > lib/messageview.go. It could even be argued that the current code is > buggy due to not setting Peek in the other cases. As an example, I just > did the following experiment on master (without this patch): I agree with this. What if this were implemented in several patches: 1. Move store.Flag to worker because it's currently redundant for IMAP, but needed for other workers 2. Add PEEK option to the worker message and all relevant function calls, with the fix to the ones that should be true 3. Add the option to set peek on opening message This approach, at least to me, makes the imap worker more efficient than it currently is, fixes some bugs, and gets this feature in. Tim