Title: Service Worker: registration.pushManager can be undefined in some mobile browser · Issue #25781 · angular/angular · GitHub
Open Graph Title: Service Worker: registration.pushManager can be undefined in some mobile browser · Issue #25781 · angular/angular
X Title: Service Worker: registration.pushManager can be undefined in some mobile browser · Issue #25781 · angular/angular
Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report Current behavior I start to use service-worker SwPush feature for webpush but some mobile browser throw Cannot read pro...
Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report Current behavior I start to use service-worker SwPush feature for webpush but s...
X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report Current behavior I start to use service-worker SwPush feature for webpush b...
Opengraph URL: https://github.com/angular/angular/issues/25781
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Service Worker: registration.pushManager can be undefined in some mobile browser","articleBody":"\u003c!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x] Bug report \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\n\u003c!-- Describe how the issue manifests. -->\r\nI start to use service-worker SwPush feature for webpush but some mobile browser throw `Cannot read property 'getSubscription' of undefined` error message. \r\n\r\n**Error Message**\r\n```\r\nTypeError: Cannot read property 'getSubscription' of undefined\r\n at project(.../node_modules/@angular/service-worker/fesm5/service-worker.js.pre-build-optimizer.js:131:99)\r\n at _next(.../node_modules/rxjs/_esm5/internal/operators/switchMap.js.pre-build-optimizer.js:34:27)\r\n at next(.../node_modules/rxjs/_esm5/internal/Subscriber.js.pre-build-optimizer.js:54:18)\r\n at _next(.../node_modules/rxjs/_esm5/internal/operators/map.js.pre-build-optimizer.js:41:26)\r\n at next(.../node_modules/rxjs/_esm5/internal/Subscriber.js.pre-build-optimizer.js:54:18)\r\n at notifyNext(.../node_modules/rxjs/_esm5/internal/operators/switchMap.js.pre-build-optimizer.js:66:26)\r\n at _next(.../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.pre-build-optimizer.js:15:21)\r\n at next(.../node_modules/rxjs/_esm5/internal/Subscriber.js.pre-build-optimizer.js:54:18)\r\n at apply(.../node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js.pre-build-optimizer.js:7:28)\r\n at invoke(.../node_modules/zone.js/dist/zone.js.pre-build-optimizer.js:388:26)\r\n at run(.../node_modules/zone.js/dist/zone.js.pre-build-optimizer.js:138:43)\r\n at apply(.../node_modules/zone.js/dist/zone.js.pre-build-optimizer.js:872:34)\r\n at invokeTask(.../node_modules/zone.js/dist/zone.js.pre-build-optimizer.js:421:31)\r\n at runTask(.../node_modules/zone.js/dist/zone.js.pre-build-optimizer.js:188:47)\r\n at drainMicroTaskQueue(.../node_modules/zone.js/dist/zone.js.pre-build-optimizer.js:595:35)\r\n```\r\n\r\n## Expected behavior\r\n\u003c!-- Describe what the desired behavior would be. -->\r\nNo error message if PushManager is undefined.\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\u003c!--\r\nFor bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).\r\n-->\r\nThese two line is problem. registration.pushManager can be undefined. \r\nhttps://github.com/angular/angular/blob/master/packages/service-worker/src/push.ts#L39\r\nhttps://github.com/angular/angular/blob/master/packages/service-worker/src/push.ts#L42\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n\u003c!-- Describe the motivation or the concrete use case. -->\r\nI just use SwPush in service-worker\r\n\r\n## Environment\r\nsome of Android 8.0 ~ 5.0.2 Chrome / Facebook browser throw the error. \r\nhttps://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/pushManager#Browser_compatibility\r\n\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 6.1.4\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\nBrowser:\r\n- [x] Chrome (Android) version 67.0.3 ~ 68.0.3\r\n- [x] Facebook (Android) version 187 \r\n\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/leo6104","@type":"Person","name":"leo6104"},"datePublished":"2018-09-01T05:09:34Z","url":"https://github.com/angular/angular/issues/25781"}
| 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:7f7a30cd-52f4-b2da-528d-9edd3d50397e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A7C:EDA7A:E86430:12827F4:6B010A67 |
| html-safe-nonce | b6caa150e63d4163fa0a4c088a8edbab2a118dd7c76256c102f73a92ddcc5435 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTdDOkVEQTdBOkU4NjQzMDoxMjgyN0Y0OjZCMDEwQTY3IiwidmlzaXRvcl9pZCI6IjM3NjAyMjc3NTQ3MjU5MzU3MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cf92cafe96fdcdf69e4403c6fcad49e98aa6b04a03eeac9217e45a732cb90dfd |
| hovercard-subject-tag | issue:356172923 |
| 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/25781/issue_layout |
| twitter:image | https://opengraph.githubassets.com/88796976636088c4796a0823b197b95daaa9adac6ffe29d529b47d9fa688ec11/angular/angular/issues/25781 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/88796976636088c4796a0823b197b95daaa9adac6ffe29d529b47d9fa688ec11/angular/angular/issues/25781 |
| og:image:alt | I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report Current behavior I start to use service-worker SwPush feature for webpush but s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leo6104 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width