Closed
Bug 1251229
Opened 9 years ago
Closed 9 years ago
request.url includes the hash of the loaded URL
Categories
(Core :: DOM: Service Workers, defect)
Tracking
()
RESOLVED
FIXED
mozilla47
| Tracking | Status | |
|---|---|---|
| firefox44 | --- | unaffected |
| firefox45 | --- | unaffected |
| firefox46 | + | fixed |
| firefox47 | + | fixed |
People
(Reporter: valentin, Assigned: bkelly)
References
(Blocks 1 open bug)
Details
(Keywords: regression, Whiteboard: btpp-fixnow)
Attachments
(2 files)
|
2.35 KB,
patch
|
ehsan.akhgari
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
|
3.51 KB,
patch
|
ehsan.akhgari
:
review+
lizzard
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Load https://awesome-sw.github.io/hello-world/#/2 (repeatedly to make sure the resources are put into the cache).
In the console you'll see that the intercepted URL includes the hash.
Moreover, in the devtools Cache storage, multiple entries for the same URL with different hashes are available.
There should only be one entry for each URL, and it should not have a hash set.
| Assignee | ||
Comment 1•9 years ago
|
||
Pretty sure we try to implement fragment stripping.
Ehsan, any thoughts? I think you were just looking at this code.
Does our parser just get confused if there is a slash inside of the fragment?
Valentin, does this work if you use URLs like "hello-world/#2"?
| Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Ben Kelly [PTO, back Feb 29][:bkelly] from comment #1)
> Pretty sure we try to implement fragment stripping.
>
> Ehsan, any thoughts? I think you were just looking at this code.
>
> Does our parser just get confused if there is a slash inside of the fragment?
> Valentin, does this work if you use URLs like "hello-world/#2"?
It doesn't seem to be the slash. It still caches hello-world/#2
Flags: needinfo?(valentin.gosu)
| Assignee | ||
Comment 3•9 years ago
|
||
This might be fallout from bug 1201664. We used to run the Request constructor which stripped the fragment, but are no longer doing that. Maybe we miss stripping the fragment now.
| Assignee | ||
Comment 4•9 years ago
|
||
Yea, this does not reproduce in FF44. Bug 1201664 was landed in FF46. I think that's probably the culprit. We should fix before it hits release and write a test for this.
Ehsan, can you take? Or I can do it next week.
Blocks: 1201664
| Assignee | ||
Comment 5•9 years ago
|
||
Actually, I may have time for this today while the movers load the truck.
Assignee: nobody → bkelly
Status: NEW → ASSIGNED
Flags: needinfo?(ehsan)
| Assignee | ||
Comment 6•9 years ago
|
||
This fixes the problem on the comment 0 site for me. I'll write a mochitest next.
Attachment #8723585 -
Flags: review?(ehsan)
Updated•9 years ago
|
Attachment #8723585 -
Flags: review?(ehsan) → review+
| Assignee | ||
Comment 7•9 years ago
|
||
This test fails without the P1 patch. It succeeds with the P1 patch.
Ehsan, do you think I need to worry about a Cache migration? I could delete request entries with a fragment. Alternatively we just tell people on dev edition and nightly to wipe any Cache objects affected by this. (They will trip on the MOZ_ASSERT in debug builds.)
Attachment #8724087 -
Flags: review?(ehsan)
| Assignee | ||
Comment 8•9 years ago
|
||
status-firefox44:
--- → unaffected
status-firefox45:
--- → unaffected
status-firefox46:
--- → affected
status-firefox47:
--- → affected
Keywords: regression
| Assignee | ||
Comment 9•9 years ago
|
||
Regarding the possibility of writing a migration, the only observable case will be if someone does cache.keys(). Those resources will not be found by match() any more because the URL will be different. So if script or devtools does a .keys() the urls-with-fragments will show up. In debug builds they will trigger the MOZ_ASSERT.
I'm inclined not to write a migration for this.
Updated•9 years ago
|
Whiteboard: btpp-fixnow
Comment 10•9 years ago
|
||
(In reply to Ben Kelly [PTO, back Feb 29][:bkelly] from comment #7)
> Created attachment 8724087 [details] [diff] [review]
> P2 Add wpt test verifying FetchEvent.request.url does not include fragments.
> r=ehsan
>
> This test fails without the P1 patch. It succeeds with the P1 patch.
>
> Ehsan, do you think I need to worry about a Cache migration? I could delete
> request entries with a fragment. Alternatively we just tell people on dev
> edition and nightly to wipe any Cache objects affected by this. (They will
> trip on the MOZ_ASSERT in debug builds.)
I think it's better to do a migration anyway. It should be fairly straightforward.
Comment 11•9 years ago
|
||
(Assuming that you're not planning to backport this to 46, of course. If you do, then I'm fine without having a migration.)
Updated•9 years ago
|
Attachment #8724087 -
Flags: review?(ehsan) → review+
| Assignee | ||
Comment 12•9 years ago
|
||
I am going to uplift to 46.
Comment 13•9 years ago
|
||
| Assignee | ||
Comment 14•9 years ago
|
||
Comment on attachment 8723585 [details] [diff] [review]
P1 Strip fragment from request URL when creating FetchEvent. r=ehsan
Approval Request Comment
[Feature/regressing bug #]: Service worker regression caused by bug 1201664.
[User impact if declined]: Sites can end up with multiple copies of the same resource in Cache and in could fail to work offline in some cases.
[Describe test coverage new/current, TreeHerder]: Tests included.
[Risks and why]: Minimal. Only affects service workers.
[String/UUID change made/needed]: None
Attachment #8723585 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Comment 15•9 years ago
|
||
Comment on attachment 8724087 [details] [diff] [review]
P2 Add wpt test verifying FetchEvent.request.url does not include fragments. r=ehsan
See comment 14.
Attachment #8724087 -
Flags: approval-mozilla-aurora?
Comment 16•9 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/982cf5b26ae1
https://hg.mozilla.org/mozilla-central/rev/d6df13193dc8
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 17•9 years ago
|
||
Tracking since this is a regression from 46.
tracking-firefox46:
--- → +
tracking-firefox47:
--- → +
Comment 18•9 years ago
|
||
Comment on attachment 8723585 [details] [diff] [review]
P1 Strip fragment from request URL when creating FetchEvent. r=ehsan
Fix for SW regression, includes tests. Please uplift to aurora.
Attachment #8723585 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 19•9 years ago
|
||
Comment on attachment 8724087 [details] [diff] [review]
P2 Add wpt test verifying FetchEvent.request.url does not include fragments. r=ehsan
Test only changes, fine to uplift to aurora
Attachment #8724087 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 20•9 years ago
|
||
| bugherder uplift | ||
Updated•9 years ago
|
Version: unspecified → 46 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•