mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-05 00:02:22 -08:00
fix: report native push diagnostics to Sentry logs
This commit is contained in:
3 files changed
+15
-5
No files matched your search
Generated
+1
-1
@@ -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",
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -12,6 +12,12 @@ const report = async (): Promise<void> => {
|
||||
|
||||
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);
|
||||
};
|
||||
}, []);
|
||||
};
|
||||
Reference in new issue
Block a user