{"record":{"id":"609bfd5945cb51d4","repo":"chatwoot/chatwoot","slug":"notification-is-not-supported","errorCode":null,"errorMessage":"Notification is not supported","messagePattern":"Notification is not supported","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"app/javascript/dashboard/helper/pushHelper.js","lineNumber":81,"sourceCode":"        userVisibleOnly: true,\n        applicationServerKey: window.chatwootConfig.vapidPublicKey,\n      })\n    )\n    .then(sendRegistrationToServer)\n    .then(() => {\n      onSuccess();\n    })\n    .catch(error => {\n      // eslint-disable-next-line no-console\n      console.error('Push subscription registration failed:', error);\n      useAlert('This browser does not support desktop notification');\n    });\n};\n\nexport const requestPushPermissions = ({ onSuccess }) => {\n  if (!('Notification' in window)) {\n    // eslint-disable-next-line no-console\n    console.warn('Notification is not supported');\n    useAlert('This browser does not support desktop notification');\n  } else if (Notification.permission === 'granted') {\n    registerSubscription(onSuccess);\n  } else if (Notification.permission !== 'denied') {\n    Notification.requestPermission(permission => {\n      if (permission === 'granted') {\n        registerSubscription(onSuccess);\n      }\n    });\n  }\n};\n","sourceCodeStart":63,"sourceCodeEnd":93,"githubUrl":"https://github.com/chatwoot/chatwoot/blob/ed230f9bc068e7a13dd5c0404d5465a204b68d4c/app/javascript/dashboard/helper/pushHelper.js#L63-L93","documentation":"requestPushPermissions warns 'Notification is not supported' when the global Notification API is absent from window (!('Notification' in window)). This is the browser-support guard of the Web Notifications API — Safari on iOS (before 16.4 web-push), some in-app/webview browsers, and legacy browsers expose no Notification constructor. The code also shows a user-facing alert ('This browser does not support desktop notification') and simply never calls onSuccess, so the requesting flow silently stalls rather than erroring.","triggerScenarios":"Clicking 'enable notifications' inside an in-app browser (Instagram/Facebook webview), iOS Safari PWA-less page on old iOS, or any embedded webview; registerSubscription/Notification.requestPermission are unreachable because every branch below the guard requires window.Notification.","commonSituations":"Mobile users opening the dashboard from social apps; enterprise webviews; kiosk browsers; QA on old device farms. Subsequent failures differ: permission 'denied' is silently dropped, and a service-worker/push registration failure logs 'Push subscription registration failed' and alerts.","solutions":["No code fix if you are the end user: open the dashboard in a standalone browser (Chrome/Firefox/Edge, Safari 16.4+ on iOS when installed to home screen).","As a developer, gate the notification UI on the same check so the option is hidden instead of failing on tap.","For webviews, detect the environment and instruct users to re-open in the system browser.","Verify service worker + push subscription are also available before showing the toggle (the API trio Notification + serviceWorker + PushManager must all exist)."],"exampleFix":"// before\nexport const requestPushPermissions = ({ onSuccess }) => {\n  if (!('Notification' in window)) {\n    console.warn('Notification is not supported');\n    useAlert('This browser does not support desktop notification');\n  } else if (Notification.permission === 'granted') {\n    registerSubscription(onSuccess);\n  }\n};\n\n// after — hide the affordance at render time instead of failing on click\nconst pushSupported =\n  typeof window !== 'undefined' &&\n  'Notification' in window &&\n  'serviceWorker' in navigator &&\n  'PushManager' in window;\n\n// template: <button v-if=\"pushSupported\" @click=\"requestPushPermissions(...)\">","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// narrow before touching the Notification API\nconst notificationsSupported =\n  typeof window !== 'undefined' && 'Notification' in window;\n\nif (notificationsSupported && Notification.permission !== 'denied') {\n  requestPushPermissions({ onSuccess });\n} else {\n  showInAppNotice('Desktop notifications need a supported browser (Chrome, Firefox, Edge, Safari 16.4+).');\n}","tryCatchPattern":null,"preventionTips":["Gate the notification toggle/button on 'Notification' in window (plus 'serviceWorker' and 'PushManager') at render time so unsupported browsers never reach the failing path.","Detect webviews (Instagram/Facebook in-app) and prompt users to open the app in a standalone browser.","Distinguish the three failure shapes in telemetry: unsupported API (this warn), permission denied (silent), and push subscription registration failure (console.error + alert)."],"tags":["push-notifications","browser-support","frontend","web-api"],"backgroundTag":"browser-api-unsupported","analyzedSha":"ed230f9bc068e7a13dd5c0404d5465a204b68d4c","analyzedAt":"2026-08-21T12:45:25.920Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}