unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Nix <nix@esperi.org.uk>
Cc: 21182@debbugs.gnu.org
Subject: bug#21182: 25.0.50; gnus: every other unread message is marked as read on each nnimap group refresh
Date: Tue, 09 Feb 2016 11:57:09 +1100	[thread overview]
Message-ID: <87d1s6itui.fsf@gnus.org> (raw)
In-Reply-To: <87bn7r3tvh.fsf@esperi.org.uk> (Nix's message of "Mon, 08 Feb 2016 19:05:38 +0000")

Nix <nix@esperi.org.uk> writes:

> It's hard to say -- I reverted the patch locally immediately. The
> problem is that whenever this goes wrong, 50% of my unread email gets
> marked as read, with no obvious way to reverse this. This is rather a
> high price to pay for replicating a bug :)
>
> I have some sacrificial folders I could give up to the cause -- I'll see
> if I can make things go wrong with them in the next day or so.

I just don't understand how the following patch could have this
effect...  

diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index ced5561..8e81abc 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -166,14 +166,21 @@ nnimap-buffer
   (nnimap-find-process-buffer nntp-server-buffer))
 
 (defun nnimap-header-parameters ()
-  (format "(UID RFC822.SIZE BODYSTRUCTURE %s)"
-	  (format
+  (let (params)
+    (push "UID" params)
+    (push "RFC822.SIZE" params)
+    (when (nnimap-capability "X-GM-EXT-1")
+      (push "X-GM-LABELS" params))

So it only adds that to the params if the server supports it...

+    (push "BODYSTRUCTURE" params)
+    (push (format
 	   (if (nnimap-ver4-p)
 	       "BODY.PEEK[HEADER.FIELDS %s]"
 	     "RFC822.HEADER.LINES %s")
 	   (append '(Subject From Date Message-Id
 			     References In-Reply-To Xref)
-		   nnmail-extra-headers))))
+		   nnmail-extra-headers))
+	  params)
+    (format "%s" (nreverse params))))

So on non-Gmail servers the result should be identical...
 
-  (let (article lines size string)
+  (let (article lines size string labels)
     (block nil
       (while (not (eobp))
 	(while (not (looking-at "\\* [0-9]+ FETCH"))
@@ -232,6 +239,9 @@ nnimap-transform-headers
 				      t)
 		   (match-string 1)))
 	(beginning-of-line)
+	(when (search-forward "X-GM-LABELS" (line-end-position) t)
+	  (setq labels (ignore-errors (read (current-buffer)))))
+	(beginning-of-line)

Again, it should have no effect on non-Gmail...

 	(when lines
 	  (insert (format "Lines: %s\n" lines)))
+	(when labels
+	  (insert (format "X-GM-LABELS: %s\n" labels)))
 	;; Most servers have a blank line after the headers, but
 	;; Davmail doesn't.
 	(unless (re-search-forward "^\r$\\|^)\r?$" nil t)

And ditto.  So it's a mystery to me why that patch should affect
anything unless you're using Gmail..

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2016-02-09  0:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 13:01 bug#21182: 25.0.50; gnus: every other unread message is marked as read on each nnimap group refresh Nick Alcock
     [not found] ` <handler.21182.B.14386068914118.ack@debbugs.gnu.org>
2015-08-03 15:04   ` Nix
2016-02-07  5:56     ` Lars Ingebrigtsen
2017-01-26 21:07       ` Lars Ingebrigtsen
2017-01-26 22:32         ` Nix
2016-02-07  5:57 ` Lars Ingebrigtsen
2016-02-08 19:05   ` Nix
2016-02-09  0:57     ` Lars Ingebrigtsen [this message]
2016-06-11 16:16   ` Nix
2016-05-22 19:26 ` Paul Eggert
     [not found] <mailman.7787.1438606938.904.bug-gnu-emacs@gnu.org>
2016-08-20  2:15 ` joyperkins07

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87d1s6itui.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=21182@debbugs.gnu.org \
    --cc=nix@esperi.org.uk \
    /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://git.savannah.gnu.org/cgit/emacs.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).