Closed Bug 1862822 Opened 11 months ago Closed 10 months ago

Messages should not be marked as read when opened in a background tab

Categories

(Thunderbird :: Message Reader UI, defect)

Thunderbird 115
defect

Tracking

(thunderbird_esr115 fixed, thunderbird120 affected)

RESOLVED FIXED
121 Branch
Tracking Status
thunderbird_esr115 --- fixed
thunderbird120 --- affected

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

(Keywords: regression)

Attachments

(2 files)

I'm sure there's a recent bug about this, but I cannot find it. Something triggered me to think about this problem anyway.

If a message is opened in a background tab (e.g. with the Open Message in New Tab context menu item) the user can't possibly have read it, because it's not visible, so it shouldn't be marked as read. We should only mark it, or start the timer to mark it, once the user switches to that tab.

As an added wrinkle, on IMAP servers messages can be marked as read as we fetch them for display (if we don't have a local copy). So that needs to be stopped too.

This changes uses the page visibility API to avoid marking messages as read until the tab is
switched to. First I had to mark background browsers as inactive for the API to work.

In order to test the behaviour with an IMAP server, I had to modify the IMAP fakeserver to send
message flags in the response to a FETCH command, as real servers do. Then I discovered the \Seen
flag isn't propagated if it's the only flag, which seems like a real problem that should be fixed.

Depends on D192299

I should point out that we didn't have this problem until we gained the ability to load more than one message in a window at any one time.

from https://mzl.la/45U0KvC, bug 1858075

Probably should be closed

  • Bug 520061 - Opening an email message in a new tab does not mark the message as read with "automatically mark as read" enabled
    We also have
  • Bug 1858075 - Unread message gets marked 'read' when I move message to another folder
  • Bug 814665 - timed "mark as read" is not consistently applied to message in standalone window/new window vs tab
Keywords: regression
Version: unspecified → Thunderbird 115
Target Milestone: --- → 121 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/e17b527b5e89
Don't mark messages in background tabs as read. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED

This is causing some debug failures.
https://treeherder.mozilla.org/jobs?repo=comm-central&selectedTaskRun=auNwqtEuSjKJm3WVTcFPrQ.0
Assertion failure: ((bool)(__builtin_expect(!!(!NS_FAILED_impl(rv)), 1))) && uri (Mutating URI should never fail), at /builds/worker/checkouts/gecko/netwerk/base/nsIOService.cpp:1025
PROCESS-CRASH | MOZ_ASSERT(((bool)(__builtin_expect(!!(!NS_FAILED_impl(rv)), 1))) && uri) (Mutating URI should never fail) [@ mozilla::net::nsIOService::CreateExposableURI] | comm/mail/base/test/browser/browser_markAsRead.js

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Found the problem.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/87df5e837524
Don't mark messages in background tabs as read. r=mkmelin

Status: REOPENED → RESOLVED
Closed: 11 months ago10 months ago
Resolution: --- → FIXED

Have you tested this with filtes? I use filters to mark spam messages and certain messages in my inbox as read so that I don't get distracted by them. I check these spam folders in set intervals (when I have time for a breather), so it is not a problem for me, if they are marked as read.

good for 115?

Flags: needinfo?(geoff)
Flags: needinfo?(geoff)
Attachment #9361762 - Flags: approval-comm-esr115?

(In reply to Thilo [:ThiloteE] from comment #9)

Have you tested this with filtes? I use filters to mark spam messages and certain messages in my inbox as read so that I don't get distracted by them. I check these spam folders in set intervals (when I have time for a breather), so it is not a problem for me, if they are marked as read.

This only affects the automatic marking-as-read that happens when a message is displayed. Doing it any other way will work as it did before.

Comment on attachment 9361762 [details]
Bug 1862822 - Don't mark messages in background tabs as read. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr115

Attachment #9361762 - Flags: approval-comm-esr115? → approval-comm-esr115+
Attachment #9367541 - Flags: review?(geoff)

Comment on attachment 9367541 [details] [diff] [review]
comm-esr115.patch

That's what I had in mind. I suggest adding to the comment at the top to say we've ripped out the IMAP bits for ESR115.

I'm having a timing issue further down the patch, so it's still failing. Investigating.

Comment on attachment 9367541 [details] [diff] [review]
comm-esr115.patch

Replace this line with await TestUtils.waitForCondition(() => secondAbout3Pane.gDBView); and it works a lot better. I'm not sure why, I guess we're missing some change that hasn't happened on ESR115.

Attachment #9367541 - Flags: review?(geoff) → review+
See Also: → 1858075
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: