Closed
Bug 1224893
Opened 9 years ago
Closed 9 years ago
Queue unexpected messages for subsequent calls to awaitMessage
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(firefox43 wontfix, firefox44 fixed, firefox45 fixed)
People
(Reporter: kmag, Assigned: kmag)
References
Details
Attachments
(1 file)
3.45 KB,
patch
|
billm
:
review+
lizzard
:
approval-mozilla-aurora+
lizzard
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
This should fix most of our intermittent failures.
![]() |
Assignee | |
Comment 1•9 years ago
|
||
I can readily reproduce the test_ext_notifications.html failure on
e10s debug builds without this patch. With it, I haven't been able
to reproduce it after 400 iterations. I haven't been able to
reproduce the test_ext_simple.html or test_ext_webRequest.html
timeouts, but as far as I can tell, they only ever turned up once.
Attachment #8687638 -
Flags: review?(wmccloskey)
![]() |
Assignee | |
Updated•9 years ago
|
Iteration: --- → 44.3 - Nov 2
Comment on attachment 8687638 [details] [diff] [review]
[webext] Queue unexpected messages for subsequent calls to awaitMessage
Review of attachment 8687638 [details] [diff] [review]:
-----------------------------------------------------------------
I have a few suggestions they're agreeable to you. This is definitely an improvement either way though.
::: testing/mochitest/tests/SimpleTest/ExtensionTestUtils.js
@@ +23,5 @@
> +
> + let [msg, ...args] = messageQueue.shift();
> + let listener = listenerQueue.shift();
> +
> + // awaitMessage calls must happen in the order the messages are expected.
If that's the case, it seems like we might as well just require there be only one outstanding awaitMessage call. That way we don't need a queue of them.
However, I'm not sure we want to do that. What if we just have a queue of messages that have arrived? Both onMessage and awaitMessage would pull things out of it. That way we would avoid races with onMessage as well. I'm not too concerned about people calling awaitMessage twice and then getting messages back that arrived in a different order. It would be nice if you could do:
yield Promise.all([ext.awaitMessage("m1"), ext.awaitMessage("m2")]);
Attachment #8687638 -
Flags: review?(wmccloskey) → review+
![]() |
Assignee | |
Comment 3•9 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #2)
> If that's the case, it seems like we might as well just require there be
> only one outstanding awaitMessage call. That way we don't need a queue of
> them.
>
> However, I'm not sure we want to do that. What if we just have a queue of
> messages that have arrived? Both onMessage and awaitMessage would pull
> things out of it. That way we would avoid races with onMessage as well. I'm
> not too concerned about people calling awaitMessage twice and then getting
> messages back that arrived in a different order. It would be nice if you
> could do:
> yield Promise.all([ext.awaitMessage("m1"), ext.awaitMessage("m2")]);
Yeah, I've been coming to the conclusion that it was a bad decision. We should still be able to use |awaitMessage| even if we don't know the order messages are going to come in.
![]() |
Assignee | |
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/eb184c427415f118f8d63ea3254a17c6ba8a7b29
Bug 1224893: [webext] Queue unexpected messages for subsequent calls to awaitMessage
![]() |
Assignee | |
Comment 5•9 years ago
|
||
I went with ignoring the order of awaitEvent calls, but still resolving await listeners strictly in the order messages come in. I meant to push that to review... I'm not sure why fx-team accepted it without an r= tag.
![]() |
Assignee | |
Comment 6•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/55585709276f4b9c00375a1ec8075198e6d8960f
Bug 1224893: [webext] Queue unexpected messages for subsequent calls to awaitMessage, follow-up. r=me r=billm
![]() |
||
Comment 7•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eb184c427415
https://hg.mozilla.org/mozilla-central/rev/55585709276f
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
![]() |
||
Comment 8•9 years ago
|
||
Let's uplift this fix to aurora and beta to take care of the test failures from bug 1226423.
![]() |
||
Comment 9•9 years ago
|
||
Comment on attachment 8687638 [details] [diff] [review]
[webext] Queue unexpected messages for subsequent calls to awaitMessage
Please uplift to aurora and beta to fix an intermittent test failure.
Attachment #8687638 -
Flags: approval-mozilla-beta+
Attachment #8687638 -
Flags: approval-mozilla-aurora+
![]() |
Assignee | |
Comment 10•9 years ago
|
||
I already pushed an uplift commit to try for aurora: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8bdea36a72fa
Uplifting to beta is probably a good idea, but I don't think the tests for bug 1226423 will apply on beta either way. It would be better not to uplift them.
Comment 11•9 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-aurora/rev/837e564f3697
https://hg.mozilla.org/releases/mozilla-aurora/rev/7d2f0faddb3f
status-firefox44:
--- → fixed
![]() |
||
Comment 12•9 years ago
|
||
OK, then let's back the tests out of beta. Thanks Kris.
remote: https://hg.mozilla.org/releases/mozilla-beta/rev/5dc47809b28c
remote: https://hg.mozilla.org/releases/mozilla-beta/rev/3007bf388ce3
status-firefox43:
--- → fixed
Comment 14•9 years ago
|
||
Backed out of beta in https://hg.mozilla.org/releases/mozilla-beta/rev/89a4374c8f67 - since the syntax error in https://treeherder.mozilla.org/logviewer.html#?job_id=663116&repo=mozilla-beta seems nonsensical I assume it actually means you're doing something unsupported on 43 or on release_build.
status-firefox43:
fixed → ---
![]() |
Assignee | |
Comment 15•9 years ago
|
||
I guess we don't have support for destructuring with spread expressions in 43. I'll back port if this becomes necessary on beta again.
Updated•9 years ago
|
Iteration: 44.3 - Nov 2 → 45.2 - Nov 30
Updated•7 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•