mark_seen confusion

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

mark_seen confusion

Carl Schaefer
it's been bothering me that simply visiting a new folder will mark a
message in that folder as "seen", so I wandered into
mail/e-mail-reader.c to see if anything could be done.

This is in the EMailReaderPrivate structure, indicating that the
behavior that's bothering me isn't supposed to be happening:

        /* These flags work together to prevent message selection
         * restoration after a folder switch from automatically
         * marking the message as read.  We only want that to
         * happen when the -user- selects a message. */
        guint folder_was_just_selected : 1;
        guint restoring_message_selection : 1;
        guint avoid_next_mark_as_seen : 1;

As far as I can tell, these three fields represent two different ways to
keep a message from being marked "seen" (the first two are one approach,
and the third is another), but they don't seem to work in 3.12.2.

I don't understand the control flow in e-mail-reader.c, but after
adding a bunch of printfs it appears that there's a lot of repetition in
how these functions are invoked (see trace below), and I think this is
why the above fields don't work: the "seen" marking operation is
correctly blocked the first time through, but the block flag is then
cleared, and a subsequent "seen" marking succeeds.

I didn't find any open bugs on this issue, so unless somebody can point
one out to me, I'll open a new one.  I did finally generate a patch that
does what I want, but it's way beyond me to vouch for its overall
correctness.  I'll put the patch in the bug report (new or existing), in
case its useful.
Carl


*** change folder
e_mail_reader_set_folder()
mail_reader_set_folder()
e_mail_reader_get_mail_display()
mail_reader_set_folder()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_message_selected_cb()
mail_reader_message_selected_cb()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_emit_folder_loaded()
mail_reader_emit_folder_loaded()
mail_reader_folder_loaded()
mail_reader_folder_loaded()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_load_status_changed_cb()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_emit_folder_loaded()
mail_reader_emit_folder_loaded()
mail_reader_folder_loaded()
mail_reader_folder_loaded()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_message_cursor_change_cb()
schedule_timeout_mark_seen()
mail_reader_message_selected_cb()
mail_reader_message_selected_cb()
mail_reader_message_selected_timeout_cb()
e_mail_reader_get_mail_display()
mail_reader_message_selected_cb()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_load_status_changed_cb()
mail_reader_message_loaded_cb()
mail_reader_message_loaded()
e_mail_reader_get_mail_display()
mail_reader_set_display_formatter_for_message()
mail_reader_message_loaded_cb()
set_mail_display_part_list()
e_mail_reader_get_mail_display()
mail_reader_load_status_changed_cb()


*** select message
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_message_cursor_change_cb()
schedule_timeout_mark_seen()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_message_cursor_change_cb()
mail_reader_message_selected_cb()
mail_reader_message_selected_cb()
mail_reader_message_selected_timeout_cb()
e_mail_reader_get_mail_display()
mail_reader_message_selected_cb()
e_mail_reader_get_mail_display()
e_mail_reader_get_mail_display()
mail_reader_load_status_changed_cb()
mail_reader_message_loaded_cb()
mail_reader_message_loaded()
e_mail_reader_get_mail_display()
mail_reader_set_display_formatter_for_message()
mail_reader_message_loaded_cb()
set_mail_display_part_list()
e_mail_reader_get_mail_display()
mail_reader_load_status_changed_cb()

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: mark_seen confusion

Patrick O'Callaghan
On Tue, 2014-05-13 at 15:44 -0400, Carl Schaefer wrote:
> it's been bothering me that simply visiting a new folder will mark a
> message in that folder as "seen", so I wandered into
> mail/e-mail-reader.c to see if anything could be done.

It's easy to prevent this by unsetting the Mark Messages Read box in
Mail Preferences. I always unset it and then explicitly mark messages as
read as I deal with them. Or is this not what you mean?

Note that Seen and Read are two different things. A message is Seen as
soon as it's reported by the IMAP server (other servers may be
different) even if you don't mark it as Read. This is how IMAP is
designed to behave.

> This is in the EMailReaderPrivate structure, indicating that the
> behavior that's bothering me isn't supposed to be happening:
>
>         /* These flags work together to prevent message selection
>          * restoration after a folder switch from automatically
>          * marking the message as read.  We only want that to
>          * happen when the -user- selects a message. */
>         guint folder_was_just_selected : 1;
>         guint restoring_message_selection : 1;
>         guint avoid_next_mark_as_seen : 1;

This seems to be more for the Evolution Hackers list rather than this
one, however you haven't said exactly what you're trying to achieve.

poc

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: mark_seen confusion

Carl Schaefer
On Tue, 2014-05-13 at 21:04 +0100, Patrick O'Callaghan wrote:
> On Tue, 2014-05-13 at 15:44 -0400, Carl Schaefer wrote:
> > it's been bothering me that simply visiting a new folder will mark a
> > message in that folder as "seen", so I wandered into
> > mail/e-mail-reader.c to see if anything could be done.
>
> It's easy to prevent this by unsetting the Mark Messages Read box in
> Mail Preferences. I always unset it and then explicitly mark messages as
> read as I deal with them.

maybe I should try that approach, it would probably help me keep my
inbox manageable.  However, I still think the current behavior with
"Mark Messages Read" checked is buggy.

> Note that Seen and Read are two different things.

perhaps in IMAP, but in evolution they appear to be the same, or at
least used interchangeably at times.  For example, the "Mark Messages
Read" preferences checkbox sets a dconf element called mark-seen.

> > This is in the EMailReaderPrivate structure, indicating that the
> > behavior that's bothering me isn't supposed to be happening:
> >
> >         /* These flags work together to prevent message selection
> >          * restoration after a folder switch from automatically
> >          * marking the message as read.  We only want that to
> >          * happen when the -user- selects a message. */
> >         guint folder_was_just_selected : 1;
> >         guint restoring_message_selection : 1;
> >         guint avoid_next_mark_as_seen : 1;
>
> This seems to be more for the Evolution Hackers list rather than this
> one, however you haven't said exactly what you're trying to achieve.

I'd like the behavior described in the comment above, i.e. switching
folders doesn't automatically mark a message as read.  Maybe I'm
confused about what that really means, but it seems to me that evolution
doesn't currently behave that way.

thanks for the pointer to evolution-hackers, I didn't know about it.
Carl
_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: mark_seen confusion

Patrick O'Callaghan
On Tue, 2014-05-13 at 16:53 -0400, Carl Schaefer wrote:
> > It's easy to prevent this by unsetting the Mark Messages Read box in
> > Mail Preferences. I always unset it and then explicitly mark
> messages as
> > read as I deal with them.
>
> maybe I should try that approach, it would probably help me keep my
> inbox manageable.  However, I still think the current behavior with
> "Mark Messages Read" checked is buggy.

Note that the message is marked as read only if you're using Preview
mode (since logically it means that you *have* read the message). If you
find messages are still being marked even with Preview turned off, that
would be a bug.

poc

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: mark_seen confusion

Milan Crha
In reply to this post by Carl Schaefer
On Tue, 2014-05-13 at 16:53 -0400, Carl Schaefer wrote:
> I'd like the behavior described in the comment above, i.e. switching
> folders doesn't automatically mark a message as read.

        Hi,
please file a bug with this description, thus it's clear what you claim
about (it wasn't clear to me in your initial message in this thread).
We'll track the issue in that bug report.
        Thanks and bye,
        Milan

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: mark_seen confusion

Carl Schaefer
In reply to this post by Patrick O'Callaghan
On Wed, 2014-05-14 at 09:33 +0100, Patrick O'Callaghan wrote:

> On Tue, 2014-05-13 at 16:53 -0400, Carl Schaefer wrote:
> > > It's easy to prevent this by unsetting the Mark Messages Read box in
> > > Mail Preferences. I always unset it and then explicitly mark messages as
> > > read as I deal with them.
> >
> > maybe I should try that approach, it would probably help me keep my
> > inbox manageable.  However, I still think the current behavior with
> > "Mark Messages Read" checked is buggy.
>
> Note that the message is marked as read only if you're using Preview
> mode (since logically it means that you *have* read the message).

that makes sense, and it does match the current behavior.  However,
having lived with the current behavior for a couple months I find myself
wanting something else, and since there's code and a comment in
e-mail-reader.c that seems to indicate the "something else" that I want
is actually the intended behavior, I'm inclined to consider the current
behavior to be a bug.
Carl
_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: mark_seen confusion

Matthew Barnes
In reply to this post by Carl Schaefer
On Tue, 2014-05-13 at 15:44 -0400, Carl Schaefer wrote:

> it's been bothering me that simply visiting a new folder will mark a
> message in that folder as "seen", so I wandered into
> mail/e-mail-reader.c to see if anything could be done.
>
> This is in the EMailReaderPrivate structure, indicating that the
> behavior that's bothering me isn't supposed to be happening:
>
> /* These flags work together to prevent message selection
> * restoration after a folder switch from automatically
> * marking the message as read.  We only want that to
> * happen when the -user- selects a message. */
> guint folder_was_just_selected : 1;
> guint restoring_message_selection : 1;
> guint avoid_next_mark_as_seen : 1;
>
> As far as I can tell, these three fields represent two different ways to
> keep a message from being marked "seen" (the first two are one approach,
> and the third is another), but they don't seem to work in 3.12.2.

The whole mark-as-seen timeout logic in that file is very confusing and
brittle due to all the asynchronous activity going on and the multitude
of reasons a message list may be regenerated.

IIRC, there was a recent attempt to fix a corner case where if the
timeout value is zero, users expect messages to be marked as read
immediately even if the message hasn't fully rendered.  Whereas non-
zero timeouts only begin AFTER the message has fully rendered.

I'm speculating, but it could very well be that fixing that case broke
the case you're describing, as brittle as that logic is.

Matthew Barnes

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list