Gnus development mailing list
 help / color / mirror / Atom feed
* messages not being marked as read on IMAP server
@ 2016-01-25 21:18 Mike Kupfer
  2016-02-06  5:41 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Kupfer @ 2016-01-25 21:18 UTC (permalink / raw)
  To: ding

I have a couple different systems that I use to connect to an IMAP
server.  I've noticed that messages that I had read--or at least marked
as read--using Gnus on system A sometimes show up as unread using Gnus
on system B.  I've finally tracked it down to this scenario:

- a message is unread and flagged (ticked) on the IMAP server.  Gnus
  shows it and the next message in the summary buffer as ticked.  (I'm
  not sure that status of the second message is critical for reproducing
  the problem, but it seems to help.)
- in the Gnus summary buffer, I type "d" for the first message.  The
  message is marked "r" in the summary buffer, as expected.
- I exit the summary buffer and type "s" in the Group buffer
- I check the folder using Thunderbird; it shows the first message as no
  longer flagged, but it's still shown as unread.

I expect the first message to be shown as read ("seen").

This is with Emacs 24.5.

With the debugger I captured the following stack trace while exiting the
summary buffer:

    Debugger entered--entering a function:
    * nnimap-send-command("UID STORE %s %sFLAGS.SILENT (%s)" "257948" "-" "\\Flagged")
      nnimap-request-set-mark("INBOX" (((257948) del (tick))) "beehive")
      gnus-request-set-mark("nnimap+beehive:INBOX" (((257948) del (tick))))
      gnus-update-marks()
      gnus-summary-update-info()
      gnus-summary-exit()
      call-interactively(gnus-summary-exit nil nil)
      command-execute(gnus-summary-exit)

I didn't notice any calls to set the Seen flag.

I tried figuring out what's going on in gnus-update-marks, but it's a
bit confusing, because there's both a gnus-newsgroup-seen list and a
gnus-newsgroup-unseen list.  Though this bit of code seems odd:

	(when (eq (cdr type) 'seen)
	  (setq list (gnus-range-add list gnus-newsgroup-unseen)))

Is it really adding seen messages to the unseen list?

mike



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: messages not being marked as read on IMAP server
  2016-01-25 21:18 messages not being marked as read on IMAP server Mike Kupfer
@ 2016-02-06  5:41 ` Lars Ingebrigtsen
  2016-02-06 22:58   ` Mike Kupfer
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-06  5:41 UTC (permalink / raw)
  To: Mike Kupfer; +Cc: ding

Mike Kupfer <m.kupfer@acm.org> writes:

> I have a couple different systems that I use to connect to an IMAP
> server.  I've noticed that messages that I had read--or at least marked
> as read--using Gnus on system A sometimes show up as unread using Gnus
> on system B.  I've finally tracked it down to this scenario:
>
> - a message is unread and flagged (ticked) on the IMAP server.  Gnus
>   shows it and the next message in the summary buffer as ticked.  (I'm
>   not sure that status of the second message is critical for reproducing
>   the problem, but it seems to help.)
> - in the Gnus summary buffer, I type "d" for the first message.  The
>   message is marked "r" in the summary buffer, as expected.
> - I exit the summary buffer and type "s" in the Group buffer
> - I check the folder using Thunderbird; it shows the first message as no
>   longer flagged, but it's still shown as unread.
>
> I expect the first message to be shown as read ("seen").

Hm...  I think "unread and flagged" is something that Gnus isn't
expecting.  It thinks that everything that's ticked (i.e. flagged) is
also read, which explains why it's not pushing the readedness change to
the IMAP server (because it doesn't think that the readedness has
changed).

I think.

> With the debugger I captured the following stack trace while exiting the
> summary buffer:
>
>     Debugger entered--entering a function:
>     * nnimap-send-command("UID STORE %s %sFLAGS.SILENT (%s)" "257948" "-" "\\Flagged")
>       nnimap-request-set-mark("INBOX" (((257948) del (tick))) "beehive")
>       gnus-request-set-mark("nnimap+beehive:INBOX" (((257948) del (tick))))
>       gnus-update-marks()
>       gnus-summary-update-info()
>       gnus-summary-exit()
>       call-interactively(gnus-summary-exit nil nil)
>       command-execute(gnus-summary-exit)
>
> I didn't notice any calls to set the Seen flag.

Yup.  I'm not quite sure what the right approach to fixing this is...
hm...

> I tried figuring out what's going on in gnus-update-marks, but it's a
> bit confusing, because there's both a gnus-newsgroup-seen list and a
> gnus-newsgroup-unseen list.  Though this bit of code seems odd:
>
> 	(when (eq (cdr type) 'seen)
> 	  (setq list (gnus-range-add list gnus-newsgroup-unseen)))

Yeah, that seems awfully weird, especially since the unseen list is
computed as the inverse of the seen list...

(defun gnus-compute-unseen-list ()
  ;; The `seen' marks are treated specially.
  (if (not gnus-newsgroup-seen)
      (setq gnus-newsgroup-unseen gnus-newsgroup-articles)
    (setq gnus-newsgroup-unseen
	  (gnus-inverse-list-range-intersection
	   gnus-newsgroup-articles gnus-newsgroup-seen))))

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: messages not being marked as read on IMAP server
  2016-02-06  5:41 ` Lars Ingebrigtsen
@ 2016-02-06 22:58   ` Mike Kupfer
  2016-02-07  2:13     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Kupfer @ 2016-02-06 22:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Lars Ingebrigtsen wrote:

> I think "unread and flagged" is something that Gnus isn't
> expecting.

I wondered if it might be something like that.  In my case, the flag is
set by a filter that runs on the IMAP server.  I put the filter in place
in case I don't have an Emacs handy and have to use Thunderbird.

> I'm not quite sure what the right approach to fixing this is...

Okay.  If you need me to provide more information or test a patch, let
me know.

thanks,
mike



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: messages not being marked as read on IMAP server
  2016-02-06 22:58   ` Mike Kupfer
@ 2016-02-07  2:13     ` Lars Ingebrigtsen
  2016-02-07 22:47       ` Mike Kupfer
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-07  2:13 UTC (permalink / raw)
  To: Mike Kupfer; +Cc: ding

Mike Kupfer <m.kupfer@acm.org> writes:

> Lars Ingebrigtsen wrote:
>
>> I think "unread and flagged" is something that Gnus isn't
>> expecting.
>
> I wondered if it might be something like that.  In my case, the flag is
> set by a filter that runs on the IMAP server.  I put the filter in place
> in case I don't have an Emacs handy and have to use Thunderbird.
>
>> I'm not quite sure what the right approach to fixing this is...
>
> Okay.  If you need me to provide more information or test a patch, let
> me know.

Could you report it as a bug with `M-x report-emacs-bug' so that I don't
forget?

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: messages not being marked as read on IMAP server
  2016-02-07  2:13     ` Lars Ingebrigtsen
@ 2016-02-07 22:47       ` Mike Kupfer
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Kupfer @ 2016-02-07 22:47 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Lars Ingebrigtsen wrote:

> Could you report it as a bug with `M-x report-emacs-bug' so that I don't
> forget?

Done: #22590.

thanks,
mike



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-07 22:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 21:18 messages not being marked as read on IMAP server Mike Kupfer
2016-02-06  5:41 ` Lars Ingebrigtsen
2016-02-06 22:58   ` Mike Kupfer
2016-02-07  2:13     ` Lars Ingebrigtsen
2016-02-07 22:47       ` Mike Kupfer

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 NNTP newsgroup(s).