{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/13269","repository_url":"https://api.github.com/repos/ampproject/amphtml","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/13269/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/13269/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/13269/events","html_url":"https://github.com/ampproject/amphtml/issues/13269","id":294522980,"number":13269,"title":"Amp validator in chrome developer tools re-requests html","user":{"login":"jeffkaufman","id":262566,"avatar_url":"https://avatars3.githubusercontent.com/u/262566?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffkaufman","html_url":"https://github.com/jeffkaufman","followers_url":"https://api.github.com/users/jeffkaufman/followers","following_url":"https://api.github.com/users/jeffkaufman/following{/other_user}","gists_url":"https://api.github.com/users/jeffkaufman/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffkaufman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffkaufman/subscriptions","organizations_url":"https://api.github.com/users/jeffkaufman/orgs","repos_url":"https://api.github.com/users/jeffkaufman/repos","events_url":"https://api.github.com/users/jeffkaufman/events{/privacy}","received_events_url":"https://api.github.com/users/jeffkaufman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ampproject/amphtml/milestones/20","html_url":"https://github.com/ampproject/amphtml/milestone/20","labels_url":"https://api.github.com/repos/ampproject/amphtml/milestones/20/labels","id":1884542,"number":20,"title":"Pending Triage","description":"These issues need to get put into another milestone. They should be assigned to the person who can best decide the appropriate milestone. Optionally, the issue can then be assigned to the most likely implementer.","creator":{"login":"rudygalfi","id":3888212,"avatar_url":"https://avatars3.githubusercontent.com/u/3888212?v=4","gravatar_id":"","url":"https://api.github.com/users/rudygalfi","html_url":"https://github.com/rudygalfi","followers_url":"https://api.github.com/users/rudygalfi/followers","following_url":"https://api.github.com/users/rudygalfi/following{/other_user}","gists_url":"https://api.github.com/users/rudygalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/rudygalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudygalfi/subscriptions","organizations_url":"https://api.github.com/users/rudygalfi/orgs","repos_url":"https://api.github.com/users/rudygalfi/repos","events_url":"https://api.github.com/users/rudygalfi/events{/privacy}","received_events_url":"https://api.github.com/users/rudygalfi/received_events","type":"User","site_admin":false},"open_issues":193,"closed_issues":726,"state":"open","created_at":"2016-07-14T23:13:22Z","updated_at":"2018-02-05T21:47:06Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-02-05T19:59:04Z","updated_at":"2018-02-05T21:49:02Z","closed_at":"2018-02-05T21:47:06Z","author_association":"NONE","body":"## What's the issue?\r\n\r\nThe validator requests the page HTML a second time.  If a page is doing a 50-50 amp-vs-html A/B test, then 25% of the time the validator will evaluate a straight HTML page as if it is AMP.  When this happens, it reports validation errors that make no sense, because if you click through to the HTML source the problem is not there.\r\n\r\n## How do we reproduce the issue?\r\n\r\nVisit https://www.jefftk.com/maybeamp#development=1 in Chrome [1]\r\n\r\n1. Open Developer Tools > Network\r\n2. Check \"Disable cache\" if it's not already checked\r\n3. Open Developer Tools > Console\r\n4. Refresh the page a few times until you see validation errors: ![tmp1](https://user-images.githubusercontent.com/262566/35825527-2235cf9c-0a84-11e8-8706-77bc20924634.png)\r\n5. Click on one of the validation errors (in this case the first one) and see that the html in the sources pane that it shows is valid amp and doesn't have the problems the validator is objecting to: ![tmp2](https://user-images.githubusercontent.com/262566/35825578-50c23530-0a84-11e8-990b-02c4f2becb16.png)\r\n\r\nAlternatively, if \"Disable Cache\" is unchecked you can get the same behavior with \"Ctrl+Shift+R\".\r\n\r\n\r\n[1] This is configured with:\r\n\r\n```\r\nhttp {\r\n  ...\r\n  split_clients $msec $amp {\r\n    50% \".amp\";\r\n    * \"\";\r\n  }\r\n  server {\r\n    ...\r\n    rewrite ^/maybeamp$ /maybeamp$amp last;\r\n  }\r\n```\r\n\r\nHalf the time it will give you a valid AMP page, the other half of the time it will give you plain HTML instead.\r\n\r\n## What browsers are affected?\r\n\r\nI see this in Chrome Developer Tools on Desktop; don't know about other browsers.\r\n\r\n## Which AMP version is affected?\r\n\r\n`Powered by AMP ⚡ HTML – Version 1516850240342`\r\n\r\nI don't know if this ever worked."},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/363232898","html_url":"https://github.com/ampproject/amphtml/issues/13269#issuecomment-363232898","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/13269","id":363232898,"user":{"login":"honeybadgerdontcare","id":1340565,"avatar_url":"https://avatars2.githubusercontent.com/u/1340565?v=4","gravatar_id":"","url":"https://api.github.com/users/honeybadgerdontcare","html_url":"https://github.com/honeybadgerdontcare","followers_url":"https://api.github.com/users/honeybadgerdontcare/followers","following_url":"https://api.github.com/users/honeybadgerdontcare/following{/other_user}","gists_url":"https://api.github.com/users/honeybadgerdontcare/gists{/gist_id}","starred_url":"https://api.github.com/users/honeybadgerdontcare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honeybadgerdontcare/subscriptions","organizations_url":"https://api.github.com/users/honeybadgerdontcare/orgs","repos_url":"https://api.github.com/users/honeybadgerdontcare/repos","events_url":"https://api.github.com/users/honeybadgerdontcare/events{/privacy}","received_events_url":"https://api.github.com/users/honeybadgerdontcare/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T21:49:02Z","updated_at":"2018-02-05T21:49:02Z","author_association":"COLLABORATOR","body":"I see this is not about the extension but about validation as a whole. Are you saying 25% of the time validation is wrong? Or that 25% of the time it may get an invalid response from the server?"}}
{"actor":{"display_login":"honeybadgerdontcare"}}