Closed Bug 1686352 Opened 4 years ago Closed 4 years ago

Fix JS errors when interacting with Folder Mode Headers

Categories

(Thunderbird :: Folder and Message Lists, defect)

defect

Tracking

(thunderbird_esr78 unaffected)

RESOLVED FIXED
86 Branch
Tracking Status
thunderbird_esr78 --- unaffected

People

(Reporter: aleca, Assigned: aleca)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

A couple of minor errors when interacting with folder mode headers.

JavaScript error: chrome://messenger/content/folderPane.js, line 1327:
TypeError: can't access property "isServer", folder is null
JavaScript error: chrome://messenger/content/folderPane.js, line 2824:
TypeError: can't access property "invalidateRow", this._tree is null

Oh wow, this error: JavaScript error: chrome://messenger/content/folderPane.js, line 2824: TypeError: can't access property "invalidateRow", this._tree is null, was happening even before my patch.

Super obscure to reproduce.
Open the Account Settings > Synchronization & Storage and click on the "Advanced..." button to open the subdialog.
Close the subdialog by clicking on the X on the top right, not Cancel or OK, but just the X.
Go back on the Mail Tab and click "Get Messages".

It seems that the closing of the subdialog is not hooked to the gFolderTreeView.unload(); leaving that Tree still listening for property changes even if it doesn't exist aymore.

This should fix the reported issues.

Attachment #9196690 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9196690 [details] [diff] [review] 1686352-folder-pane-regressions.diff Review of attachment 9196690 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/base/content/msgSelectOfflineFolders.xhtml @@ +12,5 @@ > title="&MsgSelect.label;" > width="450" height="400" > persist="width height" > + onload="gSelectOffline.load();" > + onunload="gSelectOffline.unload();"> Please instead add something like ` window.addEventListener("onunload", (event) => gFolderTreeView.unload(); }); ` ... to msgSelectOfflineFolders.js You could move the onload handler there as well while you're at it
Attachment #9196690 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → 86 Branch

Perfect, thanks for the review.

Attachment #9196690 - Attachment is obsolete: true
Attachment #9196881 - Flags: review+

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/0e5a8c9dc16b
Fix Folder mode headers javascript errors. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: