From 9aeb889a5155e45febaefd2d8f701c0f8657543a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20=C5=81yp?= Date: Mon, 25 Sep 2023 16:43:15 +0200 Subject: [PATCH] Send failed compilations pixel if needed (#2014) --- Core/PixelEvent.swift | 2 ++ DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 6 +++--- DuckDuckGo/AppDelegate.swift | 12 +++++++++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index e8e56eb258..d050a4d9e3 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -501,6 +501,7 @@ extension Pixel { case emailIncontextModalExitEarly case emailIncontextModalExitEarlyContinue + case compilationFailed case incrementalRolloutTest } @@ -978,6 +979,7 @@ extension Pixel.Event { case .emailIncontextModalExitEarly: return "m_email_incontext_modal_exit_early" case .emailIncontextModalExitEarlyContinue: return "m_email_incontext_modal_exit_early_continue" + case .compilationFailed: return "m_d_compilation_failed" // MARK: - Return user measurement case .returnUser: return "m_return_user" case .debugReturnUserAddATB: return "m_debug_return_user_add_atb" diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 163cc776d8..37e98930da 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -8928,7 +8928,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 80.1.0; + version = 80.2.0; }; }; C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4443ac2d10..9f1c57a106 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit", "state": { "branch": null, - "revision": "e7d516c7f7c2a4c588336afdf8bd2ac48457e1e4", - "version": "80.1.0" + "revision": "2bc934304fd9d5e2b51dfe78a0c95ba10f1ab5a5", + "version": "80.2.0" } }, { @@ -156,7 +156,7 @@ }, { "package": "TrackerRadarKit", - "repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit", + "repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit.git", "state": { "branch": null, "revision": "4684440d03304e7638a2c8086895367e90987463", diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index 95126bb9d3..9f347056c7 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -328,7 +328,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } syncService.scheduler.notifyAppLifecycleEvent() - + fireFailedCompilationsPixelIfNeeded() featureFlagTester.sendFeatureFlagEnabledPixelIfNecessary() } @@ -386,6 +386,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } #endif } + + private func fireFailedCompilationsPixelIfNeeded() { + let store = FailedCompilationsStore() + if store.hasAnyFailures { + DailyPixel.fire(pixel: .compilationFailed, withAdditionalParameters: store.summary) { error in + guard error != nil else { return } + store.cleanup() + } + } + } private func shouldShowKeyboardOnLaunch() -> Bool { guard let date = lastBackgroundDate else { return true }