Open Bug 1195684 Opened 9 years ago Updated 2 years ago

Trying to use an uninitialized message manager throws NS_ERROR_NOT_INITIALIZED

Categories

(DevTools :: General, defect)

defect

Tracking

(firefox43 affected)

Tracking Status
firefox43 --- affected

People

(Reporter: miker, Unassigned)

Details

To protect against this we have to use this and, I suppose, would have to use this everywhere we have async communication. try { mm.sendAsyncMessage("storage:storage-cookie-request-child", { method: methodName, args: args }); } catch(e) { // We may receive a NS_ERROR_NOT_INITIALIZED if the target window has // been closed. This can legitimately happen in between test runs. } We are sending an async message here. Anything that causes the message manager to be taken down between the message getting sent and receiving a result would result in an NS_ERROR_NOT_INITIALIZED error. Shutting down the browser, tests that quickly open and close the devtools toolbox or simply closing our tools is a typical cause of message manager communication being terminated and will be the case for every async message manager call we make. Not sure if there is anything we can do about this.
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #0) > To protect against this we have to use this and, I suppose, would have to > use this everywhere we have async communication. > > try { > mm.sendAsyncMessage("storage:storage-cookie-request-child", { > method: methodName, > args: args > }); > } catch(e) { > // We may receive a NS_ERROR_NOT_INITIALIZED if the target window has > // been closed. This can legitimately happen in between test runs. > } > > We are sending an async message here. Anything that causes the message > manager > to be taken down between the message getting sent and receiving a result > would > result in an NS_ERROR_NOT_INITIALIZED error. > This isn't true... trying to send an async message throws the error so maybe we should just check the state of the message manager before attempting to use it.
Summary: If the message manager is closed after sending an async message we get NS_ERROR_NOT_INITIALIZED → Trying to use an uninitialized message manager throws NS_ERROR_NOT_INITIALIZED
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.