Closed Bug 1751350 Opened 8 months ago Closed 3 months ago

Starred icon (flagged/favorite) in message header doesn't change when marking a message in the thread pane for Unified Folders mode (but the message state actually did change)

Categories

(Thunderbird :: Message Reader UI, defect, P1)

Thunderbird 96
x86_64
All

Tracking

(thunderbird_esr91 unaffected, thunderbird_esr102 fixed, thunderbird101 affected, thunderbird102+ affected, thunderbird103 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
thunderbird_esr91 --- unaffected
thunderbird_esr102 --- fixed
thunderbird101 --- affected
thunderbird102 + affected
thunderbird103 --- fixed

People

(Reporter: info, Assigned: aleca)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

I opened the email reader UI from the unified inbox, either in the message pane (F8) or in the standalone view.

The star button (top right) is showing the correct state of the message (yellow if starred, gray if not).

Then I clicked on the star button to toggle the starred status.

Actual results:

The status was toggled as visible in the inbox.
But the star button itself did not reflect the change.

Expected results:

When the star button was yellow before, it should then be gray and vice-versa.
This works correctly in folders that are not unified

Walt, can you reproduce this?

Flags: needinfo?(wls220spring)

Had to learn what a Star does. It's one of the items I remove from the Thread pane columns.

So IIUC:

  • I select a message in the Thread pane after setting the Folder pane to Unified view and selecting an accounts Inbox.
  • Star the message by clicking the Star to the right of More in the message header.
  • The message in the Message pane shows the star in the message header.
  • The message is not starred in the Thread pane.

I can't reproduce that using 99.0b1 on Fedora 35 Workstation.

The message is starred in the header and Thread pane, and properly toggles for me.

If I select Inbox under Unified in the Folder pane, Quick Search finds them for each account that has a starred message when I do a search using "Show only starred messages."

Reporter, can you update to 99.0b1? 97.0b2 is out of date.

Flags: needinfo?(wls220spring) → needinfo?(info)

I already updated and I can still reproduce the issue; 99.0b1 on a fresh profile (Linux Mint 20.3 Cinnamon).

See here for a demo of the issue.

I'm gonna update the affected version of this bug as well.

Flags: needinfo?(info)
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Version: Thunderbird 97 → Thunderbird 99
Version: Thunderbird 99 → Thunderbird 101

We tend to set version to the earliest known number where the problem exists.
If this is a regression, you can use https://mozilla.github.io/mozregression/ to find when it started.

Version: Thunderbird 101 → Thunderbird 97

Ah, thanks for letting me know - I didn't know that you handle the versions like that.

Using mozregression, I was able to pin this issue down to 96.0a1 (2021-11-21).
This is the exact version that the star button in the message header was introduced, so it was probably a bug from the beginning.

A thing to note about reproduction:
This bug only occurs if more than one accounts are present. With only a single account added, the star button works fine in the unified views, probably because they're just linked to the normal views.

I'm now going to set the Version to Thunderbird 96 to reflect my findings.

Version: Thunderbird 97 → Thunderbird 96

Thanks for the clarification. SO it's with the new header functionality (which I didn't read closely enough to understand). I'm not sure who implemented it

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(alessandro)
OS: Linux → All

I implemented the "Favorite" icon in the message header.
That code should properly listen to the currently selected folder, regardless of which account is selected, or if a specific folder pane mode (unified) is used.

I guess it might be possible that in unified mode, the folder pane is not showing a unique folder but rather a virtual folder with various messages from different accounts, and therefore the currently viewed message doesn't get properly refreshed when something changes.

I'll look into it.

Flags: needinfo?(alessandro)

I wouldn't consider this a regression since we never had the favorite icon in the message header before, therefore we were never tracking for that type of change, nor visually showing anything.

Assignee: nobody → alessandro

Correct, defintely not a regression. But bear in mind, for users new to Thunderbird, Unified is the default view since version 3(?). So a high percentage of users will be using unified view.

(In reply to Wayne Mery (:wsmwk) from comment #9)

Correct, defintely not a regression. But bear in mind, for users new to Thunderbird, Unified is the default view since version 3(?). So a high percentage of users will be using unified view.

Really?
I never got a unified folder mode when I add a new account.
Anyway, I'll fix this for 102 for sure.

Priority: -- → P1
Summary: using the star button in the message view from unified folders doesn't change it's visual state → Favorite icon in the message header doesn't update when marking a message in the thread pane while using Unified Folders mode
Summary: Favorite icon in the message header doesn't update when marking a message in the thread pane while using Unified Folders mode → Starred icon (flagged/favorite) in message header doesn't change when marking a message in the thread pane for Unified Folders mode (but the message state actually did change)

This seems a bit outside of my realm of expertise unfortunately.

It seems that the gDbService.registerPendingListener() doesn't properly handle unified smart folders, therefore the nsIDBChangeListener doesn't receive anything when flags or properties of messages change.
This fails also for the Junk flag, not just the favorite.

There might be something wrong in the way the smart (unified folders) are generated here: https://searchfox.org/comm-central/rev/596863bb53347e04ef78b9c19da48a3e970884fe/mail/base/content/folderPane.js#2303
Or something doesn't work properly in the nsIDBChangeListener: https://searchfox.org/comm-central/rev/596863bb53347e04ef78b9c19da48a3e970884fe/mailnews/base/src/nsMsgAccountManager.cpp#2323

I doubt the FtvSmartItem is the problem since that's also used for the regular inbox, drafts, etc, smart folders in other modes, and those work.
But I might be wrong.

Pinging Ben and Geoff to see if they have any idea.

Assignee: alessandro → nobody
Flags: needinfo?(geoff)
Flags: needinfo?(benc)

If instead of listening to the folder displayed in the thread pane we listened to the folder of the message that we're displaying the header of (gMessageDisplay.displayedMessage.folder or gFolderDisplay.selectedMessage.folder, it shouldn't matter although I think the former makes more sense here), this would work. That doesn't change the broken notifications for virtual folders, but it wouldn't matter any more.

Flags: needinfo?(geoff)
Assignee: nobody → alessandro
Status: NEW → ASSIGNED
Flags: needinfo?(benc)
Target Milestone: --- → 104 Branch

Pushed by alessandro@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/49acf4a71eb5
Fix Starred/Favorite button in message header not working with Unufied folder mode. r=darktrojan

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

Comment on attachment 9284595 [details]
Bug 1751350 - Fix Starred/Favorite button in message header not working with Unufied folder mode. r=darktrojan

[Approval Request Comment]
Regression caused by (bug #): -
User impact if declined: Marking a message as favorite when in Unified folder mode doesn't correctly updates the icon state
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): low

Attachment #9284595 - Flags: approval-comm-esr102?
Attachment #9284595 - Flags: approval-comm-beta?

Comment on attachment 9284595 [details]
Bug 1751350 - Fix Starred/Favorite button in message header not working with Unufied folder mode. r=darktrojan

[Triage Comment]
Approved for beta

Attachment #9284595 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9284595 [details]
Bug 1751350 - Fix Starred/Favorite button in message header not working with Unufied folder mode. r=darktrojan

[Triage Comment]
Approved for esr102

Attachment #9284595 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.