Closed Bug 1641345 Opened 4 years ago Closed 4 years ago

Relationship among <browser>, tabmail tab, and web-ext tabId is broken for shared messagepane tabs.

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

defect

Tracking

(thunderbird78 fixed)

RESOLVED FIXED
Thunderbird 79.0
Tracking Status
thunderbird78 --- fixed

People

(Reporter: alta88, Assigned: alta88)

Details

Attachments

(2 files, 3 obsolete files)

Aside from the root problem of the original tabmail implementation, Bug 1455471 did not account at all for a shared #messagepane among tabs and tabIds. Bug 1627556 and Bug 1628245 fixed some things but did not go all the way.

One place to see this is the uBlock extension. Any folder or message type tab opened will break the updating of the toolbar badge, after having switched among these tab types. The _browsers WeakMap keys are wrong for the tabId, being identical and all.

Attached patch tabs2.patch (obsolete) — Splinter Review

one way to fix it. not sure why a WeakMap reference to browser elements is used in Fx, but it seems pointless in Tb. the "permanentKey" part in tabmail.js can likely be removed too.

Assignee: nobody → alta88
Attachment #9152197 - Flags: review?(geoff)
Attached patch tabs3.patchSplinter Review

also clean up on tab close and make sure tab moves (event not emitted) do not break anything by using a session unique tabInfo.tabId rather than tabIndex.

Attachment #9152197 - Attachment is obsolete: true
Attachment #9152197 - Flags: review?(geoff)
Attachment #9152555 - Flags: review?(geoff)
Comment on attachment 9152555 [details] [diff] [review] tabs3.patch Review of attachment 9152555 [details] [diff] [review]: ----------------------------------------------------------------- Okay, this makes sense and is fine with me as long as it doesn't break anything.
Attachment #9152555 - Flags: review?(geoff) → review+
Status: NEW → ASSIGNED
Attached patch firstTab.patch (obsolete) — Splinter Review
  1. remove permanentKey, the only usage was for the WeakMap for we purposes.
  2. add a progresslistener to messagepane in firstTab. one is added on all subsequent shared messagepane tab types, so unless one of those is opened, messagepane never gets one. seems wrong.

The second patch has a slight risk; perhaps a try for both would be good, thanks.

Attachment #9153150 - Flags: review?(geoff)

For the first patch.

Comment on attachment 9153150 [details] [diff] [review] firstTab.patch `permanentKey` was added for Marionette. Without it, none of our Marionette or Mochitest tests run. I think you're right about the second part. I don't *think* it will cause any tests to break, but I will send this all to Try to find out.
Attachment #9153150 - Flags: review?(geoff) → review-

I can put it back, but are you sure? It was linkedBrowser that was added for the tests. The permanentKey would only be necessary if browser/linkedBrowser were being used as WeakMap keys I believe..

Yes I'm sure.

The try run is looking good. There's one failure I've never seen before but I don't think it's related. Re-running that just to be sure.

Keywords: leave-open
Target Milestone: --- → Thunderbird 78.0
Target Milestone: Thunderbird 78.0 → Thunderbird 79.0

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/0a04d2187ccd
Relationship among <browser>, tabmail tab, and web-ext tabId is broken for shared messagepane tabs. r=darktrojan

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/7d51695139a7 followup to fix lint of 0a04d2187ccd. rs=eslint DONTBUILD
Attached patch firstTab.patch (obsolete) — Splinter Review

add back permanentKey.

Attachment #9153150 - Attachment is obsolete: true
Attachment #9153400 - Flags: review?(geoff)
Attached patch firstTab.patchSplinter Review
Attachment #9153400 - Attachment is obsolete: true
Attachment #9153400 - Flags: review?(geoff)
Attachment #9153401 - Flags: review?(geoff)
Attachment #9152555 - Flags: approval-comm-beta?
Comment on attachment 9153401 [details] [diff] [review] firstTab.patch I'm pretty sure the failure I saw on Try was a red herring.
Attachment #9153401 - Flags: review?(geoff) → review+
Attachment #9153401 - Flags: approval-comm-beta?
Comment on attachment 9152555 [details] [diff] [review] tabs3.patch [Triage Comment] Approved for beta (am assuming you consider this to be low risk)
Attachment #9152555 - Flags: approval-comm-beta? → approval-comm-beta+
Comment on attachment 9153401 [details] [diff] [review] firstTab.patch [Triage Comment] Approved for beta (am assuming you consider this to be low risk)
Attachment #9153401 - Flags: approval-comm-beta? → approval-comm-beta+

Thanks, yes both are very low risk.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/c79bee7bdfcf
Fix up firstTab browser; it is no longer stored in a WeakMap (for web ext), ensure it gets a listener. r=darktrojan

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

Creator:
Created:
Updated:
Size: