Closed Bug 1689060 Opened 3 years ago Closed 3 years ago

Show experiment usage in permission list in Addon-Manager.

Categories

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

enhancement

Tracking

(thunderbird_esr78+ fixed, thunderbird86+ fixed, thunderbird87 affected)

RESOLVED FIXED
87 Branch
Tracking Status
thunderbird_esr78 + fixed
thunderbird86 + fixed
thunderbird87 --- affected

People

(Reporter: TbSync, Assigned: TbSync)

References

Details

Attachments

(3 files, 4 obsolete files)

Similar to bug 1621213 we should show the experiment usage also in the permission list. Any other real WebExtension permission (which was not prompted for in case of experiment) should not be displayed.

I was not able to write a patch for M-C, because they do not have the Experiment locale and Extension.formatPermissionStrings does the %S -> appName replacement only for selected messages, not for our "experiment".

Attachment #9199469 - Flags: review?(mkmelin+mozilla)
Attachment #9199469 - Flags: review?(mkmelin+mozilla) → review?(geoff)
Attached image permissionlist.PNG

Example of how the permission list looks like with this patch applied for an add-on using Experiments. Without this patch it would list only standard WebExtension permissions (if any).

Comment on attachment 9199469 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list.patch

My only concern is that the two blocks after this need to happen ASAP, but this code waits for a CE to exist. It's probably fine, but I'd be happier if this was moved down beyond the setting of window.browserBundle.

Attachment #9199469 - Flags: review?(geoff) → review+

Moved the code to the bottom as suggested.

Attachment #9199469 - Attachment is obsolete: true
Attachment #9199798 - Flags: review+
Version: unspecified → 78

Comment on attachment 9199798 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_v2.patch

[Approval Request Comment]
This fixes the permission list for MailExtensions using Experiments.

Regression caused by (bug #):
User impact if declined:
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky):
I guess none.

Attachment #9199798 - Flags: approval-comm-beta?
Target Milestone: --- → 87 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/28471cef02ac
show MailExtension Experiment usage in permission list. r=darktrojan

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

mac test fails, manifest is missing, follow up patch is in the making.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Regressions: 1689841
Comment on attachment 9200111 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_follow_up_mac_fix.patch

Review of attachment 9200111 [details] [diff] [review]:
-----------------------------------------------------------------

::: mail/base/content/aboutAddonsExtra.js
@@ +84,5 @@
>  
>    // Override parts of the addon-permission-list customElement to be able
>    // to show the usage of Experiments in the permission list.
>    await customElements.whenDefined("addon-permissions-list");
> +  AddonPermissionsList.prototype.setAddon = async function(addon) {

It does look a bit risky to change this function to be async. The rest of the code (in m-c) isn't really prepared for that (doesn't await it)

Than please back out the patch for now.

Attachment #9199798 - Flags: approval-comm-beta?
Attachment #9200111 - Flags: review?(geoff)
Attachment #9199798 - Attachment is obsolete: true
Attachment #9200111 - Attachment is obsolete: true

I had a look at the relevant m-c code and the method setAddon() is indeed called without being awaited for. But setAddon() itself is calling this.render() which is an async funtion without awaiting it as well.

https://searchfox.org/mozilla-central/source/toolkit/mozapps/extensions/content/aboutaddons.js#2529-2532

IIRC, in this case, it does not matter, if setAddon() is sync or async.

Attachment #9202058 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9202058 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_v3.patch

Review of attachment 9202058 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, r=mkmelin
Attachment #9202058 - Flags: review?(mkmelin+mozilla) → review+

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/b2b077dcd1e3
Show experiment usage in permission list. r=mkmelin

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED

Comment on attachment 9202058 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_v3.patch

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Wrong permission listed in add-on manager

Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky):
I do not see any

Attachment #9202058 - Flags: approval-comm-beta?

Comment on attachment 9202058 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_v3.patch

[Triage Comment]
Approved for beta

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

Thank you for fixing this, Rob!

Plan to uplift to 78?

Yes, my next uplift session including try runs to be able to request uplift is scheduled for next week.

Wrong patch.

Attachment #9207001 - Flags: approval-comm-esr78?
Attachment #9207001 - Flags: approval-comm-esr78?

This patch is for ESR78. It had to be adapted a bit, as the template does not exist and the entire XUL section needs to be created by hand, but the used technique to add the experiment permission display did not change.

Attachment #9207001 - Attachment is obsolete: true

Comment on attachment 9207028 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_ESR78_v2.patch

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Cannot see correct permissions.

Testing completed (on c-c, etc.):

Risk to taking this patch (and alternatives if risky):
Low

Attachment #9207028 - Flags: approval-comm-esr78?

Comment on attachment 9207028 [details] [diff] [review]
bug1689060_show_experiment_usage_in_permission_list_ESR78_v2.patch

[Triage Comment]
Approved for esr78

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

Attachment

General

Created:
Updated:
Size: