From 0fe67d77ccba61f2f1a116eed46e05507482aec4 Mon Sep 17 00:00:00 2001 From: innolove-dev Date: Wed, 22 Jul 2026 20:35:01 +0100 Subject: [PATCH] fix(notifications): capture notification-click listener init failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The click-listener block added in #2470 lands in a console.warn-only catch, so the native failure is invisible in Sentry — the same gap the neighbouring app-listener catch already covers. Launch URLs are suppressed in both SDKs, which makes this listener the only thing that routes a push tap: if it never registers, taps silently do nothing. Same shape as the existing capture — once per session, warning level, tagged feature:onesignal. --- src/hooks/useNativePlugins.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hooks/useNativePlugins.ts b/src/hooks/useNativePlugins.ts index 22edcaa04..2fbfcf754 100644 --- a/src/hooks/useNativePlugins.ts +++ b/src/hooks/useNativePlugins.ts @@ -15,6 +15,7 @@ import { getOneSignalAdapter } from '@/services/onesignal' * exist in native builds (not on vercel/web ci). */ let appListenersFailureCaptured = false +let clickListenerFailureCaptured = false export function useNativePlugins() { const router = useRouter() @@ -88,6 +89,15 @@ export function useNativePlugins() { ) } catch (e) { console.warn('failed to init notification click listener:', e) + // launch URLs are suppressed in the SDKs, so without this listener a push tap does nothing + if (!clickListenerFailureCaptured) { + clickListenerFailureCaptured = true + captureMessage('failed to init notification click listener', { + level: 'warning', + tags: { feature: 'onesignal', source: 'native_click_listener' }, + extra: { error: e instanceof Error ? e.message : String(e) }, + }) + } } try {