From 67caf73fb1151170dbf321e95ce45d5a9f4a9a02 Mon Sep 17 00:00:00 2001 From: Jamil Date: Sun, 5 Jan 2025 10:26:55 -0800 Subject: [PATCH] fix(apple): Use standardized Sentry release name and set dist to package type (#7668) - Updates the Sentry release name to follow `component@version` format - Uses the Sentry `dist` field to set the distribution type, `appstore|standalone` --- .../FirezoneKit/Helpers/Telemetry.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Helpers/Telemetry.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Helpers/Telemetry.swift index 1ae96961b..c7e85aba3 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Helpers/Telemetry.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Helpers/Telemetry.swift @@ -37,6 +37,7 @@ public enum Telemetry { options.dsn = "https://66c71f83675f01abfffa8eb977bcbbf7@o4507971108339712.ingest.us.sentry.io/4508175177023488" options.environment = "entrypoint" // will be reconfigured in TunnelManager options.releaseName = releaseName() + options.dist = distributionType() #if DEBUG // https://docs.sentry.io/platforms/apple/guides/ios/configuration/options/#debug @@ -87,19 +88,23 @@ public enum Telemetry { } } + private static func distributionType() -> String { + // Apps from the app store have a receipt file + if BundleHelper.isAppStore() { + return "appstore" + } + + return "standalone" + } + private static func releaseName() -> String { let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown" #if os(iOS) - return "ios-appstore-\(version)" + return "ios-client@\(version)" #else - // Apps from the app store have a receipt file - if BundleHelper.isAppStore() { - return "macos-appstore-\(version)" - } - - return "macos-client-\(version)" + return "macos-client@\(version)" #endif } }