{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/23613","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/23613/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/23613/comments","events_url":"https://api.github.com/repos/angular/angular/issues/23613/events","html_url":"https://github.com/angular/angular/issues/23613","id":318939946,"node_id":"MDU6SXNzdWUzMTg5Mzk5NDY=","number":23613,"title":"Service Worker: Hash Mismatch","user":{"login":"manfredsteyer","id":1573728,"node_id":"MDQ6VXNlcjE1NzM3Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1573728?v=4","gravatar_id":"","url":"https://api.github.com/users/manfredsteyer","html_url":"https://github.com/manfredsteyer","followers_url":"https://api.github.com/users/manfredsteyer/followers","following_url":"https://api.github.com/users/manfredsteyer/following{/other_user}","gists_url":"https://api.github.com/users/manfredsteyer/gists{/gist_id}","starred_url":"https://api.github.com/users/manfredsteyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manfredsteyer/subscriptions","organizations_url":"https://api.github.com/users/manfredsteyer/orgs","repos_url":"https://api.github.com/users/manfredsteyer/repos","events_url":"https://api.github.com/users/manfredsteyer/events{/privacy}","received_events_url":"https://api.github.com/users/manfredsteyer/received_events","type":"User","site_admin":false},"labels":[{"id":708923209,"node_id":"MDU6TGFiZWw3MDg5MjMyMDk=","url":"https://api.github.com/repos/angular/angular/labels/comp:%20service-worker","name":"comp: service-worker","color":"c5def5","default":false},{"id":130606845,"node_id":"MDU6TGFiZWwxMzA2MDY4NDU=","url":"https://api.github.com/repos/angular/angular/labels/type:%20feature","name":"type: feature","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/82","html_url":"https://github.com/angular/angular/milestone/82","labels_url":"https://api.github.com/repos/angular/angular/milestones/82/labels","id":3045967,"node_id":"MDk6TWlsZXN0b25lMzA0NTk2Nw==","number":82,"title":"Backlog","description":"Milestone for triaged issues that have not yet been scheduled for resolution.","creator":{"login":"IgorMinar","id":216296,"node_id":"MDQ6VXNlcjIxNjI5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/216296?v=4","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":1938,"closed_issues":324,"state":"open","created_at":"2018-01-18T16:52:20Z","updated_at":"2018-08-24T17:09:14Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2018-04-30T15:51:44Z","updated_at":"2018-08-24T18:55:35Z","closed_at":null,"author_association":"NONE","body":"I'd like to use this to start a discussion based upon a topic I talked about with @gkalpak at ng-conf 2018.\r\n\r\nAs mentioned in #21288, the service worker implementation checkes the hashes of the cached files and if they don't match, it just serves the data from the network (which is like having no service worker).\r\n\r\nThe problem is that every proxy on the web can manipulate the files downloaded. This is especially the case for mobile providers that are minifying and inlining a lot of stuff on the fly to save bandwith. But also tools like live-server change the index.html (and so they can be used to reproduce this issue).\r\n\r\nAs one of the big use cases for PWAs are areas with low bandwith, this is somehow conflicting.\r\n\r\nPerhaps one way to solve this is to provide an exchangeable HashCheckStrategy. In cases where I as the programmer wants to take the responsiblity for not checking the hashes in order to bypass this issue, I could write sth like this:\r\n\r\n```\r\nexport class BruceWillisHashCheckStrategy implements HashCheckStrategy {\r\n     check(currentHash, expectedHash, fileName) {\r\n         return true;\r\n     }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/415851039","html_url":"https://github.com/angular/angular/issues/23613#issuecomment-415851039","issue_url":"https://api.github.com/repos/angular/angular/issues/23613","id":415851039,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTg1MTAzOQ==","user":{"login":"jvitor83","id":3493339,"node_id":"MDQ6VXNlcjM0OTMzMzk=","avatar_url":"https://avatars2.githubusercontent.com/u/3493339?v=4","gravatar_id":"","url":"https://api.github.com/users/jvitor83","html_url":"https://github.com/jvitor83","followers_url":"https://api.github.com/users/jvitor83/followers","following_url":"https://api.github.com/users/jvitor83/following{/other_user}","gists_url":"https://api.github.com/users/jvitor83/gists{/gist_id}","starred_url":"https://api.github.com/users/jvitor83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvitor83/subscriptions","organizations_url":"https://api.github.com/users/jvitor83/orgs","repos_url":"https://api.github.com/users/jvitor83/repos","events_url":"https://api.github.com/users/jvitor83/events{/privacy}","received_events_url":"https://api.github.com/users/jvitor83/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T18:55:35Z","updated_at":"2018-08-24T18:55:35Z","author_association":"NONE","body":"Or even to use timestamp instead of version number.\r\nSo, each build has a new timestamp and update if the cached one is different."}}
{"actor":{"display_login":"jvitor83"}}