Stale unread count may persist in folder ARIA label/tooltip after messages are read or deleted
Categories
(Thunderbird :: Disability Access, defect)
Tracking
(Not tracked)
People
(Reporter: cwendling, Assigned: welpy-cw)
References
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Steps to reproduce:
Delete all unread messages in a subfolder (e.g. INBOX/subfolder)
Actual results:
The unread count badge for that directory in the accounts list properly updated (the badge disappeared as there are no more unread messages) but the a11y description of the row kept the previous value ("INBOX/subfolder, 42 unread messages" -- or so, reverse-translating from French).
Expected results:
The a11y description should update properly, even when dropping to no unread messages, and even in subfolders.
In the attached capture, you can see that the a11y treeitem node for folder Courrier entrant/debian (translating to Inbox/debian) still has a previous name value, while it's properly updated in the UI (hidden badge)
I am not entirely sure if this has to happen in a subfolder or if it's partly random, but I've been experiencing it there. I just tested with Daily 148.0a1 (2025-12-09) (64 bits) under Debian testing, but it's been like that for months at least.
Comment 1•4 months ago
|
||
Right, looks like aria-label isn't updated for 0 unread, leaving the old value there.
https://searchfox.org/comm-central/rev/b3656e2549ad7bf5b5c167eb5dc538c2fbf29448/mail/base/content/widgets/folder-tree-row.mjs#208
| Reporter | ||
Comment 2•4 months ago
|
||
@mkmelin thanks for looking into this!
Without knowing this code though, are you sure that's where lies the issue? It looks to me like the aria label is always updated with the promise pieces (L227), and that L208 just avoids adding the unread label to the promise.
At a glance, I'd be wondering whether this.readCount could still be at an old value when #updateAriaLabel() is fetching it? Or if there could be promise ordering issues as all of unreadCount, totalCount and folderSize will be updating it pretty much all at the same time? I hope not because that sounds awful to debug :)
I hope I'm wrong and just missed something though :)
Comment 3•4 months ago
|
||
I didn't try coding it so there is a chance my analysis is wrong.
| Assignee | ||
Comment 4•4 months ago
|
||
While the visible row in the folder pane is changed immediately (https://searchfox.org/comm-central/rev/7f4bed3d3e3105bc10a41a0fa7c0327a21f6f59c/mail/base/content/widgets/folder-tree-row.mjs#150-161), the aria label is localized asynchronously (https://searchfox.org/comm-central/rev/7f4bed3d3e3105bc10a41a0fa7c0327a21f6f59c/mail/base/content/widgets/folder-tree-row.mjs#227-234).
You say this happened when you deleted all unread messages, so maybe automatic compacting of the folder might kick in right afterwards, delaying the fluent localization for the aria label. Does the label eventually get updated on its own? By the way, you can easily check this by hovering the mouse and having the tooltip displayed.
Comment 5•3 months ago
|
||
Does the label eventually get updated on its own? By the way, you can easily check this by hovering the mouse and having the tooltip displayed.
| Reporter | ||
Comment 6•3 months ago
|
||
You say this happened when you deleted all unread messages, so maybe automatic compacting of the folder might kick in right afterwards, delaying the fluent localization for the aria label. Does the label eventually get updated on its own?
It doesn't seem so no, it also happens removing a single email (although it's the only unread), and waiting a few minutes doesn't seem to help. Also, there's no visible mention of compacting going on.
By the way, you can easily check this by hovering the mouse and having the tooltip displayed.
Ah yeah good point, the tooltips are wrong as well, still include how many unread there was before deletion.
| Reporter | ||
Comment 7•3 months ago
|
||
Showing 1 shadow unread mail on the Inbox (in French)
| Reporter | ||
Comment 8•3 months ago
|
||
Showing 13 shadow unread mails on a subfolder (in French)
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 9•12 days ago
|
||
This commit addresses several performance and state management issues within the FolderTreeRow component:
- Decoupled State: Migrated
unreadCount,totalCount, andfolderSizefrom
reading directly from the DOM (textContent) to using private class fields
as the single source of truth. Added early-exit equality checks to setters to
prevent unnecessary DOM work. - Race Condition Fix: Implemented an
AbortControllerinside#updateAriaLabel
to ensure older, delayed localization promises do not overwrite newer state
updates. - Performance/Debouncing: Added
#scheduleAriaLabelUpdateto batch rapid,
sequential property updates (e.g., during an email sync) into a single 50ms
delayed localization call. - Layout Optimization: Centralized the
nodeValueupdate logic into
#updateTextNodeto successfully bypass thechildListMutationObserver
across all folder labels, preventing unnecessary layout recalculations. - Documentation: Corrected JSDoc for
folderSizeto accurately reflect its
string return type.
Updated•12 days ago
|
| Assignee | ||
Updated•12 days ago
|
Updated•9 days ago
|
| Assignee | ||
Updated•1 day ago
|
Comment 10•1 day ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/79cfa268c280
Refactor FolderTreeRow state management and fix ARIA label race condition. r=darktrojan,aleca
Comment 11•19 hours ago
|
||
We had to back-out this patch, because it introduced intermittent test fails for mac:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=631b14e88444c4bec341531356be100ba9eb0fbb&group_state=expanded&selectedTaskRun=PTGbLsOWTQqYihi3wAwmHA.0
We have run a try without it and could not trigger the same failure:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=756f740c90555ccfb20bb3668b65d12afed53801
Geoff did some investigations, but could not find what might be causing it.
@welpy-cw : Do you have an idea?
Comment 12•19 hours ago
|
||
| Assignee | ||
Comment 13•17 hours ago
|
||
(In reply to John Bieling from comment #11)
We had to back-out this patch, because it introduced intermittent test fails for mac:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=631b14e88444c4bec341531356be100ba9eb0fbb&group_state=expanded&selectedTaskRun=PTGbLsOWTQqYihi3wAwmHA.0We have run a try without it and could not trigger the same failure:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=756f740c90555ccfb20bb3668b65d12afed53801Geoff did some investigations, but could not find what might be causing it.
@welpy-cw : Do you have an idea?
Yes, I have a fix for bug 1962967 that should resolve this. But we have to wait until Treeherder is working again to be sure…
| Assignee | ||
Updated•13 hours ago
|
Comment 14•8 hours ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/b72fa3cfa74b
Refactor FolderTreeRow state management and fix ARIA label race condition. r=aleca,darktrojan
Description
•