nsMsgDBFolder.mNumUnreadMessages can get out-of-date calling MarkMessagesRead
Categories
(MailNews Core :: General, defect)
Tracking
(thunderbird_esr102 wontfix, thunderbird_esr115 fixed, thunderbird117 fixed)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr115+
|
Details | Review |
Usually when calling nsMsgDBFolder::MarkMessagesRead the count of unread messages mNumUnreadMessages is updated via
nsMsgHdr::MarkReadnsMsgDatabase::MarkReadnsMsgDatabase::MarkHdrReadnsMsgDatabase::MarkHdrReadInDBnsMsgDBFolder::OnHdrFlagsChangednsMsgDBFolder::UpdateSummaryTotals
but in some cases OnHdrFlagsChanged doesn't get called. I assume that for some reason we've stopped listening to database notifications.
This could explain a lot of weirdness, quite likely including bug 1833345. I have a test that fails every time, which is how I figured out what's happening. (Not the first time I've run into this problem while writing tests, I'm sure.) I'll try to reduce it to the minimum required to show the bug, then figure out the best fix. If nothing else works we can just call UpdateSummaryTotals at the end of MarkMessagesRead, which is essentially a no-op if it has already been called.
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
Comment 3•2 years ago
|
||
I ranted about null msgDatabase issues in Bug 1795178. Basically, I think msgDatabase should be a read-only attr, and never null (even if the database file is closed).
But I think it'd be a lot of work to understand the mork/nsMsgDatabase code well enough to make that change, so for now we limp along adding bandaids like this one until we do a more substantial overhaul of database stuff.
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/8058f3a4ecdc
Restore folder database before marking messages as read or flagged. r=BenC
Comment 5•2 years ago
|
||
Comment on attachment 9347057 [details]
Bug 1846860 - Restore folder database before marking messages as read or flagged. r=BenC
[Triage Comment]
Approved for beta
Comment 6•2 years ago
|
||
| bugherder uplift | ||
Thunderbird 117.0b2:
https://hg.mozilla.org/releases/comm-beta/rev/cb0c329c678d
| Assignee | ||
Comment 7•2 years ago
|
||
Comment on attachment 9347057 [details]
Bug 1846860 - Restore folder database before marking messages as read or flagged. r=BenC
[Approval Request Comment]
Regression caused by (bug #): ancient history
User impact if declined: unread message counts can be wrong
Testing completed (on c-c, etc.): in beta 2
Risk to taking this patch (and alternatives if risky): no
Comment 8•2 years ago
|
||
Comment on attachment 9347057 [details]
Bug 1846860 - Restore folder database before marking messages as read or flagged. r=BenC
[Triage Comment]
Approved for esr115
Comment 9•2 years ago
|
||
| bugherder uplift | ||
Thunderbird 115.2.0:
https://hg.mozilla.org/releases/comm-esr115/rev/28423e49cfb2
Description
•