From ef074216d6954e6129b668d0f2bf23b5326dc743 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Mon, 7 Sep 2026 19:19:38 +0200 Subject: [PATCH] fix: report native push diagnostics to Sentry logs --- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 6 +++--- src/app/hooks/usePushDiagnosticsReport.ts | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index e700be9db..bdcc072bd 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -8325,7 +8325,7 @@ dependencies = [ [[package]] name = "tauri-plugin-notifications" version = "0.5.0" -source = "git+https://github.com/SableClient/tauri-plugin-notifications.git?rev=a88516315e3fd75a38993bf318649bcfb61864ff#a88516315e3fd75a38993bf318649bcfb61864ff" +source = "git+https://github.com/SableClient/tauri-plugin-notifications.git?rev=ac93b116a345146d7207329191a5bbda8e58b012#ac93b116a345146d7207329191a5bbda8e58b012" dependencies = [ "log", "notify-rust", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 3a2ee0b42..0aac3529a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -110,12 +110,12 @@ windows = { version = "0.62", features = [ tauri-plugin-single-instance = { version = "2.4.3", features = ["deep-link"] } [target.'cfg(any(windows, target_os = "linux"))'.dependencies] -tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "a88516315e3fd75a38993bf318649bcfb61864ff" } +tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "ac93b116a345146d7207329191a5bbda8e58b012" } # default-features = false drops notify-rust so macOS uses the native # UNUserNotificationCenter backend (needs a signed .app to deliver). [target.'cfg(target_os = "macos")'.dependencies] -tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "a88516315e3fd75a38993bf318649bcfb61864ff", default-features = false } +tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "ac93b116a345146d7207329191a5bbda8e58b012", default-features = false } [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-updater = { version = "2", optional = true } @@ -139,7 +139,7 @@ libloading = "0.9" zbus = "5" [target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies] -tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "a88516315e3fd75a38993bf318649bcfb61864ff", features = [ +tauri-plugin-notifications = { git = "https://github.com/SableClient/tauri-plugin-notifications.git", rev = "ac93b116a345146d7207329191a5bbda8e58b012", features = [ "push-notifications", ] } tauri-plugin-edge-to-edge = { git = "https://github.com/SableClient/tauri-plugin-edge-to-edge.git", rev = "33c6116c27be28c06df5a9d02231ecc5fdeb93c5" } diff --git a/src/app/hooks/usePushDiagnosticsReport.ts b/src/app/hooks/usePushDiagnosticsReport.ts index 4f9c564b3..13563389d 100644 --- a/src/app/hooks/usePushDiagnosticsReport.ts +++ b/src/app/hooks/usePushDiagnosticsReport.ts @@ -12,6 +12,12 @@ const report = async (): Promise => { entries.forEach(([outcome, occurrences]) => { Sentry.metrics.count('sable.push.cold_outcome', occurrences, { attributes: { outcome } }); + Sentry.logger.info('Native push diagnostic', { + outcome, + occurrences, + lastOutcome: diagnostics.lastOutcome ?? '', + lastAt: diagnostics.lastAt, + }); }); Sentry.addBreadcrumb({ @@ -31,9 +37,13 @@ export const usePushDiagnosticsReport = (): void => { void report(); }; + const interval = window.setInterval(drain, 30_000); document.addEventListener('visibilitychange', drain); drain(); - return () => document.removeEventListener('visibilitychange', drain); + return () => { + window.clearInterval(interval); + document.removeEventListener('visibilitychange', drain); + }; }, []); };