Skip to content

Commit

Permalink
Send failed compilations pixel if needed (#2014)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp authored Sep 25, 2023
1 parent 0d95a02 commit 9aeb889
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ extension Pixel {
case emailIncontextModalExitEarly
case emailIncontextModalExitEarlyContinue

case compilationFailed
case incrementalRolloutTest
}

Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8928,7 +8928,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 80.1.0;
version = 80.2.0;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down Expand Up @@ -156,7 +156,7 @@
},
{
"package": "TrackerRadarKit",
"repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit",
"repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit.git",
"state": {
"branch": null,
"revision": "4684440d03304e7638a2c8086895367e90987463",
Expand Down
12 changes: 11 additions & 1 deletion DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

syncService.scheduler.notifyAppLifecycleEvent()

fireFailedCompilationsPixelIfNeeded()
featureFlagTester.sendFeatureFlagEnabledPixelIfNecessary()
}

Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 9aeb889

Please sign in to comment.