Closed Bug 801257 Opened 7 years ago Closed 7 years ago
System Message API: Page would wrongly handle messages to be sent to other pages
This only happens within the same App. When calling SystemMessageInternal.sendMessage(), it would send the message to all the pages that used to be registered in the _listeners[aManifestURI.spec], which is wrong. I think we need to add a check in the SystemMessageManager to handle only the message that has the matched page URI; otherwise, ignore it. This fix can also prevent this page from wrongly clearing the pending messages in other pages when sending back an acknowledgement later.
Hi Fabrice, Could you please review this when you have a chance? Changes are trivial. Please see comment #0 for why we need to fix that. In summary, pageA would wrongly handle the message that should be sent to pageB (within the same App). Thanks Fabrice again!
NIT: add braces for one line if-block.
Attachment #671052 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/37fead15ae60 Should this have a test?
No, thanks. :)
Flags: in-testsuite? → in-testsuite-
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.