{"action":"created","issue":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/759","labels_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/759/labels{/name}","comments_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/759/comments","events_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/759/events","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/759","id":111271941,"number":759,"title":"seems possible to trigger many update fetches after 24 hour limit expires","user":{"login":"wanderview","id":1256526,"avatar_url":"https://avatars.githubusercontent.com/u/1256526?v=3","gravatar_id":"","url":"https://api.github.com/users/wanderview","html_url":"https://github.com/wanderview","followers_url":"https://api.github.com/users/wanderview/followers","following_url":"https://api.github.com/users/wanderview/following{/other_user}","gists_url":"https://api.github.com/users/wanderview/gists{/gist_id}","starred_url":"https://api.github.com/users/wanderview/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanderview/subscriptions","organizations_url":"https://api.github.com/users/wanderview/orgs","repos_url":"https://api.github.com/users/wanderview/repos","events_url":"https://api.github.com/users/wanderview/events{/privacy}","received_events_url":"https://api.github.com/users/wanderview/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-13T21:11:09Z","updated_at":"2015-10-14T02:17:49Z","closed_at":null,"body":"Step 7 of Handle Functional Event checks the last update time:\r\n\r\n> If the time difference in seconds calculated by the current time minus registration's last update check time is greater than 86400, invoke Soft Update algorithm, or its equivalent, with registration.\r\n\r\nStep 13 of the Update algorithm ultimately sets the last update time:\r\n\r\n> If response's cache state is not \"local\", set registration's last update check time to the current time.\r\n\r\nOf course, it only does this after the async step 11:\r\n\r\n> Let response be the result of running fetch using r.\r\n\r\nWhile waiting for the fetch you may end up with multiple update requests queued.\r\n\r\nNow each update will run sequentially thanks to step 4.1 doing the CheckPriority step, but they will each attempt a network fetch.  I guess http cache may avoid the network hit here, but we're still doing a lot of extra work.\r\n\r\nCan we somehow de-bounce these updates?  Like don't queue updates for the 24 hour expiration unless the queue is empty?  This would let .update() still force another update, but avoid a burst of events triggering a lot of soft updates."},"comment":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/comments/147904842","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/759#issuecomment-147904842","issue_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/759","id":147904842,"user":{"login":"jungkees","id":1331169,"avatar_url":"https://avatars.githubusercontent.com/u/1331169?v=3","gravatar_id":"","url":"https://api.github.com/users/jungkees","html_url":"https://github.com/jungkees","followers_url":"https://api.github.com/users/jungkees/followers","following_url":"https://api.github.com/users/jungkees/following{/other_user}","gists_url":"https://api.github.com/users/jungkees/gists{/gist_id}","starred_url":"https://api.github.com/users/jungkees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jungkees/subscriptions","organizations_url":"https://api.github.com/users/jungkees/orgs","repos_url":"https://api.github.com/users/jungkees/repos","events_url":"https://api.github.com/users/jungkees/events{/privacy}","received_events_url":"https://api.github.com/users/jungkees/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T02:17:49Z","updated_at":"2015-10-14T02:17:49Z","body":"I think the name, _registration queue_, is a bit misleading as it deals with the update jobs. Better to rename it to _update queue_?"}}