From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.bugs Subject: bug#54158: 28.0.91; duplicate mail downloads in Gnus (IMAP) Date: Sat, 19 Mar 2022 22:50:44 -0500 Message-ID: <87czihuvsb.fsf@gnu.org> References: <87tucmc2y4.fsf@gnu.org> <87lex5mwzf.fsf@ust.hk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12968"; mail-complaints-to="usenet@ciao.gmane.io" To: 54158@debbugs.gnu.org Cancel-Lock: sha1:QbzC6Eb3h7C/Iklg9UFbD/su844= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 20 04:51:30 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nVmbK-0003CW-5R for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 04:51:30 +0100 Original-Received: from localhost ([::1]:52252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVmbI-0003Ci-Jn for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 23:51:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVmas-0003CY-1o for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 23:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVmar-0007RE-OT for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 23:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nVmar-0006kb-Ku for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 23:51:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87tucmc2y4.fsf@gnu.org> Resent-From: Roland Winkler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Mar 2022 03:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54158 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164774825525937 (code B ref -1); Sun, 20 Mar 2022 03:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Mar 2022 03:50:55 +0000 Original-Received: from localhost ([127.0.0.1]:60919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVmal-0006kH-27 for submit@debbugs.gnu.org; Sat, 19 Mar 2022 23:50:55 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVmaj-0006k9-Gc for submit@debbugs.gnu.org; Sat, 19 Mar 2022 23:50:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVmaj-0003B4-4E for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 23:50:53 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:60622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVmah-0007Pd-I8 for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2022 23:50:52 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nVmaf-0002IK-5k for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 04:50:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228612 Archived-At: On Sun, Mar 20 2022, Andrew Cohen wrote: >>I am surprised that `mail-source-fetch-imap' in Gnus from Emacs 27.2 >>and from Emacs 28.0.91 are essentially the same (from all I can tell). >>So I am wondering why `mail-source-fetch-imap' in Gnus from Emacs 27.2 >>was behaving as expected; but the bug showed up only in Emacs 28. Can >>this be in subtle ways related to the fact that mail-source.el in Emacs >>27 used dynamic binding, whereas in Emacs 28 it uses lexical binding, >>as speculated previously by Eric? > > This is indeed a mystery. If you are excited about getting to the bottom > of it you could try enabling the log with emacs-27 and post the result > of your scenario. The problem was the variable 'remove was accumulating > UIDs from prior iterations of the loop. I am perplexed: Certainly, I struggled for the longest time to identify a reproducible recipe for this bug till I learned about the variable imap-log (see my earlier posts in this thread). Indeed, with this recipe the bug does show up both with Emacs 28.0.91 and Emacs 27.2. So I need to take back what I said before that this bug is a regression. Reading the code of `mail-source-fetch-imap' more carefully, I agree with you: it would be a mystery if the code had ever worked as intended. A possible explanation from my side is: while I started using Gnus about mid of last year when I had Emacs 27.2, I added a second IMAP folder to my `mail-sources' configuration more recently, possibly around the time when I switched from 27.2 to 28.0.91. Then I got fooled by this bug because I didn't know its actual cause. While I went back temporarily from 28.0.91 to 27.2 to see whether this changed anything, I may have done that for too short an amount of time to run into the particular situation that triggers this bug. Oh well. Thanks to everyone who has helped to find the cause of this bug!