Extension / WebExtensionPolicy stub is not unregistered when startup fails early
Categories
(WebExtensions :: General, defect, P1)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
Details
Attachments
(2 files)
The Extension
's startup()
method has cleanup logic in a catch
block, which consists of printing the error, unregistering the WebExtensionPolicy
(stub) instance and cleaning up generated files.
This logic is skipped when startup()
fails early because there is an early return
when the manifest/localization initialization has failed.
As a result, there will be a stale, always-active WebExtensionPolicy
without extension
.
Due to bug 1651838, manifest initialization failed, which combined with this bug was responsible for causing bug 1651697 (https://github.com/mozilla-mobile/fenix/issues/12399).
To fix this part of the issue, we should ensure that the cleanup is always run.
Assignee | ||
Comment 1•4 years ago
|
||
In most cases, the presence of any errors causes an error to be thrown
at startup. Sometimes, that is not the case, and as a result the
extension is not properly unregistered.
Assignee | ||
Comment 2•4 years ago
|
||
This is necessary because otherwise callers of policy.readyPromise can
get stuck when an extension fails to start up.
Updated•4 years ago
|
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/75a4fa219844 Ensure that cleanup is run when startup() exits early r=rpl https://hg.mozilla.org/integration/autoland/rev/39ab9832a71c Ensure that readyPromise is resolved when startup() exits early r=rpl
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/75a4fa219844
https://hg.mozilla.org/mozilla-central/rev/39ab9832a71c
Description
•