Closed Bug 1777487 Opened 2 years ago Closed 2 years ago

Only query active StreamFilters if webRequestBlocking permission is granted and prevent race with extension shutdown

Categories

(WebExtensions :: Request Handling, defect, P1)

defect

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

While investigating Bug 1774497 TV intermittent failure, we have noticed that we could restrict the call to ParentAPIManager.queryStreamFilterSuspendCancel to the extensions that have a webRequestBlocking permission granted.

In addition to that, I investigate the race that Bug 1774497 caught (which I was able to also trigger locally on an android x86 debug build by using --verify and --disable-fission mach xpcshell-test cli options) because skipping the call to queryStreamFilterSuspendCancel for extensions without the "webRequestBlocking" permission was going to hide that and there were actually two kind of errors that the race between the call to queryStreamFilterSuspendCancel to be resolved and the extension being shutdown in the meantime:

  • ExtensionParent.ParentAPIManager.queryStreamFilterSuspendCancel may reject with an AbortError if the extension shutdown before the returned promise is resolved
  • this.extension may be nullified by the time we are going to call this.onShutdown(false) nearby the end of the terminateBackground async function
Summary: Restrict terminateBackground query for active stream filters to extensions with a granted webRequestBlocking permission and prevent unhandled rejections due to extension shutdown completed before the query call is resolved → Only query active StreamFilters if webRequestBlocking permission is granted and prevent race with extension shutdown
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Pushed by luca.greco@alcacoop.it:
https://hg.mozilla.org/integration/autoland/rev/205ee354f198
Only query active StreamFilters if webRequestBlocking permission is granted and prevent race with extension shutdown. r=mixedpuppy
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: