Closed Bug 1623976 Opened 4 years ago Closed 4 years ago

JSWindowActorParent.sendQuery() after didDestroy throws an uncatchable error NS_ERROR_NOT_AVAILABLE

Categories

(Core :: DOM: Content Processes, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: zombie, Unassigned)

Details

Add this:
https://phabricator.services.mozilla.com/D67671

and run:
mach test dom/ipc/tests/JSWindowActor/browser_sendQuery.js

Despite both catching the call and handling the resulting promise, test fails with A promise chain failed to handle a rejection: [Exception... "Component is not available".... It's coming from:
https://searchfox.org/mozilla-central/rev/6cd54550a2/dom/ipc/JSWindowActor.cpp#390-391

Obviously, calling sendQuery after didDestroy is not gonna be useful, but that's what promise rejection (and/or throwing) is supposed to be for. I don't understand the point of an opaque error message that fails the test and doesn't point at the problem, and is basically unaffected by any JS debug code I was trying to add (only after Nika showed me what to look for was I able to find it).

This is made worse by willDestroy not reliably getting called for parent actors, and I also think this can happen when two actors from the same tab get destroyed at the same time, and the first one tries to send a message to the second from didDestroy (not knowing that it's also gone, since that didDestroy hasn't fired yet).

Summary: JSWindowActorParent.sendQuery() after didDestroy throw an uncatchable error NS_ERROR_NOT_AVAILABLE → JSWindowActorParent.sendQuery() after didDestroy throws an uncatchable error NS_ERROR_NOT_AVAILABLE

WONTFIX because Nika says this is intended behavior.

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