Closed Bug 1892074 Opened 8 months ago Closed 8 months ago

restoreThreadState() is not called when changing sort order for virtual folders

Categories

(Thunderbird :: Folder and Message Lists, defect, P1)

Thunderbird 126

Tracking

(thunderbird_esr115 unaffected, thunderbird126 verified, thunderbird127 affected)

VERIFIED FIXED
127 Branch
Tracking Status
thunderbird_esr115 --- unaffected
thunderbird126 --- verified
thunderbird127 --- affected

People

(Reporter: aleca, Assigned: welpy-cw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR:

  • Open a virtual folder (example tags)
  • Set cards view
  • Change the sort order to Grouped by sort, and back to Threaded

The style is not properly updated because the restoreThreadState() method is never called, so the proper attributes are never refreshed.

This is because the view isn't regenerated or resorted in this case, see here. I think threadTree.dataset.showGroupedBySort should be set in this function here. Maybe we could extract this setting from restoreThreadState() and make it its own function to be more flexible.

Blocks: 1892065

I'm also noticing that for regular folder the command is run twice...oh boy

console.trace:
chrome://messenger/content/about3Pane.js 4790 restoreThreadState
chrome://messenger/content/mailCommon.js 993 onCreatedView
resource:///modules/DBViewWrapper.sys.mjs 1544 _applyViewChanges
resource:///modules/DBViewWrapper.sys.mjs 1509 set _viewFlags
resource:///modules/DBViewWrapper.sys.mjs 1948 set showThreaded
chrome://messenger/content/about3Pane.js 6220 sortThreaded
chrome://messenger/content/about3Pane.js 6078 handleCommand
chrome://messenger/content/about3Pane.js 6260
chrome://messenger/content/mailCommon.js 733 doCommand
chrome://messenger/content/globalOverlay.js 99 goDoCommand
about:3pane 1 oncommand
console.trace:
chrome://messenger/content/about3Pane.js 4790 restoreThreadState
chrome://messenger/content/mailCommon.js 1026 onMessagesLoaded
resource:///modules/DBViewWrapper.sys.mjs 1558 _applyViewChanges
resource:///modules/DBViewWrapper.sys.mjs 1509 set _viewFlags
resource:///modules/DBViewWrapper.sys.mjs 1948 set showThreaded
chrome://messenger/content/about3Pane.js 6220 sortThreaded
chrome://messenger/content/about3Pane.js 6078 handleCommand
chrome://messenger/content/about3Pane.js 6260
chrome://messenger/content/mailCommon.js 733 doCommand
chrome://messenger/content/globalOverlay.js 99 goDoCommand
about:3pane 1 oncommand

(In reply to Hartmut Welpmann [:welpy-cw] from comment #1)

I think threadTree.dataset.showGroupedBySort should be set in this function here. Maybe we could extract this setting from restoreThreadState() and make it its own function to be more flexible.

Or just put it into updateListRole().

We need a condition that distinguish regular folders from smart folders (does it only affect smart tags folders?) and run the restoreThreadState() only for those because all other scenarios are covered by the set _viewFlags() as you correctly pointed out.

Or maybe we should take a hard a look at the DBViewWrapper.sys.mjs and properly fix this inconsistency, if possible.

  • Set proper style attributes in threadTree when changing between grouped-by-sort and threaded in multi-folder search views.
  • Actually set the collapsed/expanded state either in onCreatedView or in onMessagesLoaded(all)
  • Correctly restore expand-all state of grouped-by-sort multi-folder search views (Bug 1892065)
Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Target Milestone: --- → 127 Branch
Blocks: 1892308

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/76db2279c298
Make restoreThreadState() more versatile. r=aleca

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

Comment on attachment 9397256 [details]
Bug 1892074 - Make restoreThreadState() more versatile. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): bug 1889021
User impact if declined: expand-all state of grouped-by-sort multi-folder search views is not restored.
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): low

Attachment #9397256 - Flags: approval-comm-beta?
Regressions: 1895097

Comment on attachment 9397256 [details]
Bug 1892074 - Make restoreThreadState() more versatile. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

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

Hello,

Managed to reproduce the issue with the affected build from 2024-04-17 (20240417092556) .

Confirming this issue as verified fixed with 126.0b3(20240506165103) using Windows 11, macOS 14 and Ubuntu 22.

Status: RESOLVED → VERIFIED
Version: unspecified → Thunderbird 128
Version: Thunderbird 128 → Thunderbird 126
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: