Title: Service worker locked in EXISTING_CLIENTS_ONLY state · Issue #31109 · angular/angular · GitHub
Open Graph Title: Service worker locked in EXISTING_CLIENTS_ONLY state · Issue #31109 · angular/angular
X Title: Service worker locked in EXISTING_CLIENTS_ONLY state · Issue #31109 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/pwa Is this a regression? Not a regression I think. Description If a network failure happens, the service worker will enter the EXISTING_CLIENTS_ONLY state. If a conne...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/pwa Is this a regression? Not a regression I think. Description If a network failure happens, the service worker will enter the...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/pwa Is this a regression? Not a regression I think. Description If a network failure happens, the service worker will enter the...
Opengraph URL: https://github.com/angular/angular/issues/31109
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Service worker locked in EXISTING_CLIENTS_ONLY state","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n\r\nThe issue is caused by package @angular/pwa\r\n\r\n### Is this a regression?\r\n\r\nNot a regression I think.\r\n\r\n### Description\r\n\r\nIf a network failure happens, the service worker will enter the\r\n`EXISTING_CLIENTS_ONLY` state.\r\n\r\nIf a connected client reloads (F5), the service worker will stay in that state\r\nforever and serve nothing to the client, nor to other clients or reloading clients.\r\n\r\nIn my opinion, it would be better if the service worker kept serving the old\r\ncached version, while waiting for the network to recover and the update to occur successfully.\r\nOtherwise, offline mode is broken.\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\nTo enter `EXISTING_CLIENTS_ONLY` state:\r\n\r\n1. Create an Angular app:\r\n\r\n mkdir drop_me\r\n cd drop_me\r\n npm install @angular/cli\r\n node_modules/.bin/ng new my-dream-app\r\n cd my-dream-app\r\n node_modules/.bin/ng add @angular/pwa --project my-dream-app\r\n node_modules/.bin/ng build --prod\r\n npm install http-server\r\n node_modules/.bin/http-server -p 8080 -c-1 dist/my-dream-app\r\n\r\n2. Open `http://localhost:8080` in Chrome and wait for the page\r\n\r\n3. Kill the server\r\n\r\n4. Change something in `src/app/app.component.html`\r\n\r\n5. Rebuild and serve:\r\n\r\n node_modules/.bin/ng build --prod\r\n node_modules/.bin/http-server -p 8080 -c-1 dist/my-dream-app\r\n\r\n6. Go back in Chrome, it `slow 3g network` in dev tool, hit F5, and wait for\r\nthe service worker to start downloading `index.html`, `main.js` or any file of\r\nthe update.\r\n\r\n When that happen, check chrome devtool `Offline` checkbox.\r\n\r\n The service worker is now in `EXISTING_CLIENTS_ONLY`.\r\n\r\n\r\nFrom now, to create the issue, just hit F5.\r\n\r\nThe application will be broken offline, even after network reconnection,\r\ntab close/re-open, etc.\r\n\r\nFor me, beside unregistering the service worker manually, only a new update of\r\nthe application can fix the state.\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 8.0.3\r\nNode: 11.5.0\r\nOS: linux x64\r\nAngular: 8.0.1\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router, service-worker\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.800.3\r\n@angular-devkit/build-angular 0.800.3\r\n@angular-devkit/build-optimizer 0.800.3\r\n@angular-devkit/build-webpack 0.800.3\r\n@angular-devkit/core 8.0.3\r\n@angular-devkit/schematics 8.0.3\r\n@angular/cli 8.0.3\r\n@angular/pwa 0.800.3\r\n@ngtools/webpack 8.0.3\r\n@schematics/angular 8.0.3\r\n@schematics/update 0.800.3\r\nrxjs 6.4.0\r\ntypescript 3.4.5\r\nwebpack 4.30.0\r\n\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\r\nOnly tested on Chrome.\r\n","author":{"url":"https://github.com/H--o-l","@type":"Person","name":"H--o-l"},"datePublished":"2019-06-18T15:16:55Z","url":"https://github.com/angular/angular/issues/31109"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b72dc1e1-3bd2-69ab-0526-63e83ae9fbe5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CBB0:91CF4:15F97C6:1D1749F:6B012C31 |
| html-safe-nonce | 991f2f45036f2942a2b66e822c58d1f74eead72fac456ca0817a8c6871b51f84 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkIwOjkxQ0Y0OjE1Rjk3QzY6MUQxNzQ5Rjo2QjAxMkMzMSIsInZpc2l0b3JfaWQiOiI0MTc3MjE2MzU4NDQzOTg1OTY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5a9130db9fccfef8b3193f64f2394f4f5bdfd62248cf1fc0fe63f7f0b7dabd6d |
| hovercard-subject-tag | issue:457543444 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/31109/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46d0716aaf4b49d5c47e6316dea9e5f8e17ee59bf6be2374a3578cf671055f34/angular/angular/issues/31109 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46d0716aaf4b49d5c47e6316dea9e5f8e17ee59bf6be2374a3578cf671055f34/angular/angular/issues/31109 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/pwa Is this a regression? Not a regression I think. Description If a network failure happens, the service worker will enter the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | H--o-l |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width