System Message API: Page would wrongly handle messages to be sent to other pages

RESOLVED FIXED in Firefox 18

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Gene Lian (I already quit Mozilla), Assigned: Gene Lian (I already quit Mozilla))

Tracking

Trunk
mozilla19
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(blocking-basecamp:+, firefox18 fixed, firefox19 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

6 years ago
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.
(Assignee)

Updated

6 years ago
Assignee: nobody → clian
Blocks: 777206, 755245
(Assignee)

Comment 1

6 years ago
Created attachment 671050 [details] [diff] [review]
Patch

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!
Attachment #671050 - Flags: review?(fabrice)
(Assignee)

Comment 2

6 years ago
Created attachment 671051 [details] [diff] [review]
Patch 1.1

NIT: add braces for one line if-block.
Attachment #671050 - Attachment is obsolete: true
Attachment #671050 - Flags: review?(fabrice)
Attachment #671051 - Flags: review?(fabrice)
(Assignee)

Comment 3

6 years ago
Created attachment 671052 [details] [diff] [review]
Patch 1.1
Attachment #671051 - Attachment is obsolete: true
Attachment #671051 - Flags: review?(fabrice)
Attachment #671052 - Flags: review?(fabrice)
Attachment #671052 - Flags: review?(fabrice) → review+
blocking-basecamp: --- → ?
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
blocking-basecamp: ? → +
https://hg.mozilla.org/integration/mozilla-inbound/rev/37fead15ae60

Should this have a test?
Flags: in-testsuite?
Keywords: checkin-needed
(Assignee)

Comment 5

6 years ago
No, thanks. :)
Flags: in-testsuite? → in-testsuite-

Comment 6

6 years ago
https://hg.mozilla.org/mozilla-central/rev/37fead15ae60
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
https://hg.mozilla.org/releases/mozilla-aurora/rev/137a3c517823
status-firefox18: --- → fixed
status-firefox19: --- → fixed
You need to log in before you can comment on or make changes to this bug.