Open Bug 1251141 Opened 8 years ago Updated 2 years ago

loadChromeScript's sendAsyncMessage actually uses _sendSyncMessage

Categories

(Testing :: Mochitest, defect)

defect

Tracking

(Not tracked)

People

(Reporter: MattN, Unassigned)

References

Details

loadChromeScript's sendAsyncMessage calls this._sendSyncMessage so we have the method name declaring that it's asynchronous but then the implementation is actually synchronous. I'm guessing this was a mistake. Alex, can you confirm?

For some tests I need synchronous behaviour so I think we should add sendSyncMessage in bug 1153128.

In this bug I think we should make sendAsyncMessage actually async (or remove it) and update all existing references to use sendSyncMessage since at this point some consumers may be relying on it's synchronous implementation.
Flags: needinfo?(poirot.alex)
Oh! Yes, it looks like a mistake. My very first usage of this API doesn't rely on it being sync.

Be careful if you just replace its internal sendSync by sendAsync, it may break the world.
I would say it is better to keep it and use it everywhere we don't have to be sync.
Flags: needinfo?(poirot.alex)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.