If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Multiple runtime.onMessage listeners unable to respond

RESOLVED FIXED in mozilla48

Status

()

Toolkit
WebExtensions: Untriaged
P2
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Marc, Assigned: kmag)

Tracking

46 Branch
mozilla48
Points:
---
Bug Flags:
blocking-webextensions +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [runtime])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Created attachment 8721547 [details]
Simple WebExtension showing onMessage response issue.

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.28 Safari/537.36

Steps to reproduce:

I have two runtime.onMessage listeners, each needing the capability to respond inline via their "sendResponse" parameters.

Under Chrome, both do respond, under Firefox only the first instance does.

I'm attaching a simple WebExtension that shows the issue more clearly.


Actual results:

Only the first instance of runtime.onMessage.addListener() responds, the rest are silent.


Expected results:

All instances of runtime.onMessage.addListener() should be able to respond.  Agreed that only one can respond *at a time*, but that's up to the developer ;).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-webextensions?
Whiteboard: [runtime]

Updated

2 years ago
Flags: blocking-webextensions? → blocking-webextensions+
Priority: -- → P2

Updated

2 years ago
Assignee: nobody → lgreco
Luca, have you already started on this?

I didn't realize it was already assigned, but I was planning to work on it.

Comment 2

2 years ago
(In reply to Kris Maglione [:kmag] from comment #1)
> Luca, have you already started on this?
> 
> I didn't realize it was already assigned, but I was planning to work on it.

I started to look into it around the end of the week (starting by exploring the components which provide the features and evaluating how far they were from the changes applied elsewhere in out WebExtensions internals).

No worries (I had the feeling that it could probably start to overlap a bit with Bug 1248497, which you were already working on).
Thanks
Assignee: lgreco → kmaglione+bmo
Iteration: --- → 47.3 - Mar 7
https://hg.mozilla.org/mozilla-central/rev/557e8160f351
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Depends on: 1220154
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
(Reporter)

Comment 5

2 years ago
In 47.0a2 (2016-03-11) this does not appear to be fixed :(.

In the test extension above, only one message gets received by the content script, not two.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This landed in Firefox 48. The fix isn't present in 47.
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

2 years ago
Oh, I see.  Sorry about that.  Unfortunately this means I'll have to wait another 6 weeks to further test my extension.
You should be able to test it on 48. In any case, I plan to request uplift to 47 next week, so you shouldn't have to wait an entire 6 weeks for this to land on Aurora.
(Reporter)

Comment 9

2 years ago
That would be great, thanks ;).
Is there any proper way of manually testing this bug?
Flags: needinfo?(kmaglione+bmo)
In this case, I think the unit tests should be enough.
Flags: needinfo?(kmaglione+bmo)
You need to log in before you can comment on or make changes to this bug.