Closed
Bug 1174078
Opened 9 years ago
Closed 9 years ago
Calling "fetch" inside Service Worker's "onfetch" handler in b2g causes "onfetch" again that leads to an infinite loop
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
FxOS-S1 (26Jun)
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: azasypkin, Assigned: ferjm)
References
Details
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
nsm
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
nsm
:
review+
|
Details | Diff | Splinter Review |
STR:
1. Install [1] as preinstalled app (to workaround bug 1173539);
2. Run it and make sure that service worker is registered;
3. Kill app with Task Manager and run again;
4. Observe log - there is infinite loop that infinitely requests first resource in the app index.html - app.css.
Flame PVT mc Engineering Build:
Build Identifier: 20150611010205
Git Commit Info: 2015-06-11 18:43:32, 4219419a
[1] https://github.com/azasypkin/sw-tests/tree/master/fxos-app
Assignee | ||
Updated•9 years ago
|
Whiteboard: [s4]
Assignee | ||
Updated•9 years ago
|
Updated•9 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → NGA S3 (26Jun)
Comment 1•9 years ago
|
||
Is this an issue with intercepting the app: protocol?
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #1)
> Is this an issue with intercepting the app: protocol?
I was able to reproduce it only with app:// protocol on b2g. I tried to run app in b2g browser [1], but service worker registration was always failing for me at that time, so I just gave up.
[1] http://azasypkin.github.io/sw-tests/fxos-app/
Assignee | ||
Comment 3•9 years ago
|
||
I'll be adding a new test on another patch
Attachment #8622374 -
Flags: review?(nsm.nikhil)
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #1)
> Is this an issue with intercepting the app: protocol?
Yes, this is only happening with the app:// protocol.
Updated•9 years ago
|
Whiteboard: [s4]
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8622404 -
Flags: review?(nsm.nikhil)
Comment on attachment 8622374 [details] [diff] [review]
v1
Review of attachment 8622374 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/protocol/app/AppProtocolHandler.cpp
@@ +297,5 @@
> }
>
> +NS_IMETHODIMP DummyChannel::ForceNoIntercept()
> +{
> + return NS_OK;
return NS_ERROR_NOT_IMPLEMENTED?
Attachment #8622374 -
Flags: review?(nsm.nikhil) → review+
Comment on attachment 8622404 [details] [diff] [review]
Test
Review of attachment 8622404 [details] [diff] [review]:
-----------------------------------------------------------------
I'd like to see the new patch.
::: dom/workers/test/serviceworkers/app-protocol/sw.js
@@ +22,5 @@
> + var results = regex.exec(event.request.url);
> + return results === null ?
> + '' :
> + decodeURIComponent(results[1].replace(/\+/g, ' '));
> + }
Please use the URL and URLSearchParams interfaces instead of manual regexp parsing.
Attachment #8622404 -
Flags: review?(nsm.nikhil)
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8622404 -
Attachment is obsolete: true
Attachment #8622953 -
Flags: review?(nsm.nikhil)
Comment on attachment 8622953 [details] [diff] [review]
Test
Review of attachment 8622953 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/workers/test/serviceworkers/app-protocol/sw.js
@@ +16,5 @@
> });
>
> self.addEventListener('fetch', (event) => {
> if (event.request.url.indexOf('foo.txt') >= 0) {
> + var searchParams = new URLSearchParams(event.request.url.split("?")[1]);
var searchParams = new URLSearchParams(new URL(event.request.url));
Attachment #8622953 -
Flags: review?(nsm.nikhil) → review+
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e8d2c117e4b1
https://hg.mozilla.org/mozilla-central/rev/9ea2dfc3325d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox41:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Comment 12•9 years ago
|
||
checked in today's m-c build (6/18) with Flame device and it works as expected. Thanks for fixing it so quickly!
Comment 13•9 years ago
|
||
As NGA Program Manager suggested, let's replace the NGA-X milestones with FxOS-Sx ones (more generic ones), once Bug 1174794 has already landed
Updated•9 years ago
|
Target Milestone: NGA S3 (26Jun) → FxOS-S1 (26Jun)
You need to log in
before you can comment on or make changes to this bug.
Description
•