New issue
Advanced search Search tips

Issue 844302 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

automatic mapping does not work on remote server, but works on localhost

Reported by 0400...@gmail.com, May 18 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.30 Safari/537.36

Steps to reproduce the problem:
A number of devs complain about broken Mapping feature. I could not make it work at all, but found an interesting case that my shed some light on what's going on. 

Considering "automagic", i'm dealing with blackbox here, not really knowing what file / tree attributes Chrome considers during mapping process. 

1. 
2. 
3. 

What is the expected behavior?

What went wrong?
Same CSS-file is served via same protocol & path from remote and from local server. 
Remote server uses nginx, localhost is simply `python -m SimpleHTTPServer 8000`

Upon loading, mapping does not work: none of the files are matched. 

Then I manually change in Elements tab:
- <link rel="stylesheet" type="text/css" href="/i/styles_v6.7.css?1526617171">
+ <link rel="stylesheet" type="text/css" href="http://localhost:8000/i/styles_v6.7.css?1526617171">

And now mapping works! Once again: css-file is identical, no minification, no gzip... Really perplexing "automagical" behaviour. 

Headers (as it's the only thing I can imagine that matters in such case). 

Remote server:
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 18 May 2018 04:19:31 GMT
Content-Type: text/css
Content-Length: 54113
Last-Modified: Fri, 18 May 2018 04:13:31 GMT
Connection: keep-alive
Vary: Accept-Encoding
ETag: "5afe52eb-d361"
Expires: Fri, 18 May 2018 07:19:31 GMT
Cache-Control: max-age=10800
Cache-Control: public
Accept-Ranges: bytes

Local server:
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/2.7.13
Date: Fri, 18 May 2018 04:28:06 GMT
Content-type: text/css
Content-Length: 54113
Last-Modified: Fri, 18 May 2018 04:13:20 GMT

Did this work before? No 

Chrome version: 67.0.3396.30  Channel: beta
OS Version: OS X 10.12.6
Flash Version:
 
Untitled.png
43.4 KB View Download
Untitled 2.png
36.1 KB View Download
Owner: einbinder@chromium.org
Status: Assigned (was: Unconfirmed)
This is probably due to metadata mismatch (e.g. last modified time) which we use to establish at least some mapping when the filenames do not match. Joel, mind taking a look?
Status: WontFix (was: Assigned)
Yes, this is working as intended because the last modified time is mismatched. 

When you have a remote server, automapping is usually not the right solution because when you edit the files in DevTools, it can't update the remote files. Instead, take a look at Local Overrides: https://developers.google.com/web/updates/2018/01/devtools#overrides

Comment 3 by 0400...@gmail.com, May 22 2018

Thanks for following up.

I understand that Chrome checks Last Modified time in case of filenames mismatch, so I removed ?cache-buster and touched local files (to make sure they have more recent dates than served by remote server) -- still no mapping. To what degree should files names match? Full path, including domain? I tried applying Overrides and then added to Mapping the folder it created (with full domain in path) -- no luck either.

Does modified date have to be exact same as on server? Due to lack of documentation,  folks on SO are confused as well:
https://stackoverflow.com/questions/48032249/chromes-map-to-file-system-resource-not-working-after-update?answertab=votes#tab-top

I will update our deploy pipeline to make sure Modified Date matches, but once local file is updated by Chrome, dates will diverge again, so... 

p.s. one problem with overrides -- it creates a full domain path to files, which does not match my local tree, so I have to maintain an extra file copy just for Overrides to work or create a symlink or smth else. Mapping is less intrusive in general (when it works). 

p.p.s Workspaces Mapping docs are long out of date as well: https://developers.google.com/web/tools/setup/setup-workflow

Sign in to add a comment