From e55083a39985eaf1853f0dcc352f317e922c1256 Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Wed, 20 Nov 2024 13:52:50 -0500 Subject: [PATCH 1/7] Create UserDefault value crashReportCohortID. --- DuckDuckGo/AppSettings.swift | 1 + DuckDuckGo/AppUserDefaults.swift | 14 ++++++++++++++ DuckDuckGoTests/AppSettingsMock.swift | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/AppSettings.swift b/DuckDuckGo/AppSettings.swift index f7242d9a88..4a07684b5f 100644 --- a/DuckDuckGo/AppSettings.swift +++ b/DuckDuckGo/AppSettings.swift @@ -80,6 +80,7 @@ protocol AppSettings: AnyObject, AppDebugSettings { var crashCollectionOptInStatus: CrashCollectionOptInStatus { get set } var crashCollectionShouldRevertOptedInStatusTrigger: Int { get set } + var crashReportCohortID: String? { get set } var duckPlayerMode: DuckPlayerMode { get set } var duckPlayerAskModeOverlayHidden: Bool { get set } diff --git a/DuckDuckGo/AppUserDefaults.swift b/DuckDuckGo/AppUserDefaults.swift index 2c17e2ac1e..9bc1ede85c 100644 --- a/DuckDuckGo/AppUserDefaults.swift +++ b/DuckDuckGo/AppUserDefaults.swift @@ -76,6 +76,7 @@ public class AppUserDefaults: AppSettings { static let crashCollectionOptInStatus = "com.duckduckgo.ios.crashCollectionOptInStatus" static let crashCollectionShouldRevertOptedInStatusTrigger = "com.duckduckgo.ios.crashCollectionShouldRevertOptedInStatusTrigger" + static let crashReportCohortID = "com.duckduckgo.ios.crashReportCohortID" static let duckPlayerMode = "com.duckduckgo.ios.duckPlayerMode" static let duckPlayerAskModeOverlayHidden = "com.duckduckgo.ios.duckPlayerAskModeOverlayHidden" @@ -413,6 +414,19 @@ public class AppUserDefaults: AppSettings { } } + var crashReportCohortID: String? { + get { + if let crcid = userDefaults?.string(forKey: Keys.crashReportCohortID) { + return crcid + } else { + return nil + } + } + set { + userDefaults?.setValue(newValue, forKey: Keys.crashReportCohortID) + } + } + var duckPlayerMode: DuckPlayerMode { get { if let value = userDefaults?.string(forKey: Keys.duckPlayerMode), diff --git a/DuckDuckGoTests/AppSettingsMock.swift b/DuckDuckGoTests/AppSettingsMock.swift index 13ced3eb65..76648f7a30 100644 --- a/DuckDuckGoTests/AppSettingsMock.swift +++ b/DuckDuckGoTests/AppSettingsMock.swift @@ -82,8 +82,8 @@ class AppSettingsMock: AppSettings { var autoconsentEnabled = true var crashCollectionOptInStatus: CrashCollectionOptInStatus = .undetermined - var crashCollectionShouldRevertOptedInStatusTrigger: Int = 0 + var crashReportCohortID: String? var newTabPageSectionsEnabled: Bool = false From a790cf8ad7d46a5871b0ceeed3dcbe8b12cb1d67 Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Wed, 4 Dec 2024 14:31:20 -0500 Subject: [PATCH 2/7] Conform to new CrashCollection init signature --- DuckDuckGo/AppDelegate.swift | 2 +- DuckDuckGo/CrashCollectionOnboarding.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index 1f6cb0cf60..d269146ab3 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -81,7 +81,7 @@ import os.log private var syncStateCancellable: AnyCancellable? private var isSyncInProgressCancellable: AnyCancellable? - private let crashCollection = CrashCollection(platform: .iOS) + private let crashCollection = CrashCollection(crashReportSender: CrashReportSender(platform: .iOS)) private var crashReportUploaderOnboarding: CrashCollectionOnboarding? private var autofillPixelReporter: AutofillPixelReporter? diff --git a/DuckDuckGo/CrashCollectionOnboarding.swift b/DuckDuckGo/CrashCollectionOnboarding.swift index dd9e54af7c..e66cf7bffc 100644 --- a/DuckDuckGo/CrashCollectionOnboarding.swift +++ b/DuckDuckGo/CrashCollectionOnboarding.swift @@ -55,6 +55,8 @@ final class CrashCollectionOnboarding: NSObject { func presentOnboardingIfNeeded(for payloads: [Data], from viewController: UIViewController, sendReport: @escaping () -> Void) { let isCurrentlyPresenting = viewController.presentedViewController != nil + // Note: DO NOT TURN THIS ON until updated screens for the opt-in prompt and screen for reviewing the kinds of data + // we collect are updated (project coming soon) if featureFlagger.isFeatureOn(.crashReportOptInStatusResetting) { if appSettings.crashCollectionOptInStatus == .optedIn && appSettings.crashCollectionShouldRevertOptedInStatusTrigger < crashCollectionShouldRevertOptedInStatusTriggerTargetValue { @@ -63,6 +65,8 @@ final class CrashCollectionOnboarding: NSObject { } } + // TODO: Clear CRCID when user opts out of crash reporting from settings menu + guard shouldPresentOnboarding, !isCurrentlyPresenting else { if appSettings.crashCollectionOptInStatus == .optedIn { sendReport() From 7f314acac1242346995f46e5584ee73edc6277a1 Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Thu, 5 Dec 2024 16:06:14 -0500 Subject: [PATCH 3/7] Clear crcid when opting out of crash reporting Remove app-level CRCID user setting, and prepare for clearing CRCID owned by BSK (BSK changes still to come). --- DuckDuckGo/AppSettings.swift | 1 - DuckDuckGo/AppUserDefaults.swift | 16 +--------------- DuckDuckGo/CrashCollectionOnboarding.swift | 3 +-- .../CrashCollectionOnboardingViewModel.swift | 3 +++ DuckDuckGo/SettingsViewModel.swift | 3 +++ DuckDuckGoTests/AppSettingsMock.swift | 1 - 6 files changed, 8 insertions(+), 19 deletions(-) diff --git a/DuckDuckGo/AppSettings.swift b/DuckDuckGo/AppSettings.swift index 4a07684b5f..f7242d9a88 100644 --- a/DuckDuckGo/AppSettings.swift +++ b/DuckDuckGo/AppSettings.swift @@ -80,7 +80,6 @@ protocol AppSettings: AnyObject, AppDebugSettings { var crashCollectionOptInStatus: CrashCollectionOptInStatus { get set } var crashCollectionShouldRevertOptedInStatusTrigger: Int { get set } - var crashReportCohortID: String? { get set } var duckPlayerMode: DuckPlayerMode { get set } var duckPlayerAskModeOverlayHidden: Bool { get set } diff --git a/DuckDuckGo/AppUserDefaults.swift b/DuckDuckGo/AppUserDefaults.swift index 9bc1ede85c..df880d42d6 100644 --- a/DuckDuckGo/AppUserDefaults.swift +++ b/DuckDuckGo/AppUserDefaults.swift @@ -76,8 +76,7 @@ public class AppUserDefaults: AppSettings { static let crashCollectionOptInStatus = "com.duckduckgo.ios.crashCollectionOptInStatus" static let crashCollectionShouldRevertOptedInStatusTrigger = "com.duckduckgo.ios.crashCollectionShouldRevertOptedInStatusTrigger" - static let crashReportCohortID = "com.duckduckgo.ios.crashReportCohortID" - + static let duckPlayerMode = "com.duckduckgo.ios.duckPlayerMode" static let duckPlayerAskModeOverlayHidden = "com.duckduckgo.ios.duckPlayerAskModeOverlayHidden" static let duckPlayerOpenInNewTab = "com.duckduckgo.ios.duckPlayerOpenInNewTab" @@ -414,19 +413,6 @@ public class AppUserDefaults: AppSettings { } } - var crashReportCohortID: String? { - get { - if let crcid = userDefaults?.string(forKey: Keys.crashReportCohortID) { - return crcid - } else { - return nil - } - } - set { - userDefaults?.setValue(newValue, forKey: Keys.crashReportCohortID) - } - } - var duckPlayerMode: DuckPlayerMode { get { if let value = userDefaults?.string(forKey: Keys.duckPlayerMode), diff --git a/DuckDuckGo/CrashCollectionOnboarding.swift b/DuckDuckGo/CrashCollectionOnboarding.swift index e66cf7bffc..7dac3c6265 100644 --- a/DuckDuckGo/CrashCollectionOnboarding.swift +++ b/DuckDuckGo/CrashCollectionOnboarding.swift @@ -60,13 +60,12 @@ final class CrashCollectionOnboarding: NSObject { if featureFlagger.isFeatureOn(.crashReportOptInStatusResetting) { if appSettings.crashCollectionOptInStatus == .optedIn && appSettings.crashCollectionShouldRevertOptedInStatusTrigger < crashCollectionShouldRevertOptedInStatusTriggerTargetValue { + appSettings.crashCollectionOptInStatus = .undetermined appSettings.crashCollectionShouldRevertOptedInStatusTrigger = crashCollectionShouldRevertOptedInStatusTriggerTargetValue } } - // TODO: Clear CRCID when user opts out of crash reporting from settings menu - guard shouldPresentOnboarding, !isCurrentlyPresenting else { if appSettings.crashCollectionOptInStatus == .optedIn { sendReport() diff --git a/DuckDuckGo/CrashCollectionOnboardingViewModel.swift b/DuckDuckGo/CrashCollectionOnboardingViewModel.swift index bd641f257b..c8ad67dda3 100644 --- a/DuckDuckGo/CrashCollectionOnboardingViewModel.swift +++ b/DuckDuckGo/CrashCollectionOnboardingViewModel.swift @@ -106,6 +106,9 @@ final class CrashCollectionOnboardingViewModel: ObservableObject { } set { appSettings.crashCollectionOptInStatus = newValue + if appSettings.crashCollectionOptInStatus == .optedOut { + // TODO: Clear any potentially stored crcid + } } } } diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index a97700ad72..177935cbe8 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -353,6 +353,9 @@ final class SettingsViewModel: ObservableObject { Binding( get: { self.state.crashCollectionOptInStatus == .optedIn }, set: { + if self.appSettings.crashCollectionOptInStatus == .optedIn && $0 == false { + // TODO: Clear crcid when switching from Opt In to Opt Out + } self.appSettings.crashCollectionOptInStatus = $0 ? .optedIn : .optedOut self.state.crashCollectionOptInStatus = $0 ? .optedIn : .optedOut } diff --git a/DuckDuckGoTests/AppSettingsMock.swift b/DuckDuckGoTests/AppSettingsMock.swift index 76648f7a30..bfd5fff474 100644 --- a/DuckDuckGoTests/AppSettingsMock.swift +++ b/DuckDuckGoTests/AppSettingsMock.swift @@ -83,7 +83,6 @@ class AppSettingsMock: AppSettings { var crashCollectionOptInStatus: CrashCollectionOptInStatus = .undetermined var crashCollectionShouldRevertOptedInStatusTrigger: Int = 0 - var crashReportCohortID: String? var newTabPageSectionsEnabled: Bool = false From 4cb922b14995f9a0e12e94c5b18fc921049c478c Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Fri, 6 Dec 2024 10:29:46 -0500 Subject: [PATCH 4/7] Fix crcid clearing on opt-out Oops, clearing CRCID needs to be done through CrashCollection, which now supports this properly. --- DuckDuckGo/SettingsViewModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index 177935cbe8..9b757ddb85 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -25,6 +25,7 @@ import Common import Combine import SyncUI import DuckPlayer +import Crashes import Subscription import NetworkProtection @@ -354,7 +355,8 @@ final class SettingsViewModel: ObservableObject { get: { self.state.crashCollectionOptInStatus == .optedIn }, set: { if self.appSettings.crashCollectionOptInStatus == .optedIn && $0 == false { - // TODO: Clear crcid when switching from Opt In to Opt Out + let crashCollection = CrashCollection(crashReportSender: CrashReportSender(platform: .iOS)) + crashCollection.clearCRCID() } self.appSettings.crashCollectionOptInStatus = $0 ? .optedIn : .optedOut self.state.crashCollectionOptInStatus = $0 ? .optedIn : .optedOut From b2fecb4210c7e7ded39efda353621f0c8dbe46db Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Fri, 6 Dec 2024 10:40:06 -0500 Subject: [PATCH 5/7] Clear CRCID when opting out from crash report prompt screen --- DuckDuckGo/CrashCollectionOnboardingViewModel.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/CrashCollectionOnboardingViewModel.swift b/DuckDuckGo/CrashCollectionOnboardingViewModel.swift index c8ad67dda3..c88ec3fbbb 100644 --- a/DuckDuckGo/CrashCollectionOnboardingViewModel.swift +++ b/DuckDuckGo/CrashCollectionOnboardingViewModel.swift @@ -19,6 +19,7 @@ import Foundation import SwiftUI +import Crashes final class CrashCollectionOnboardingViewModel: ObservableObject { @@ -107,7 +108,8 @@ final class CrashCollectionOnboardingViewModel: ObservableObject { set { appSettings.crashCollectionOptInStatus = newValue if appSettings.crashCollectionOptInStatus == .optedOut { - // TODO: Clear any potentially stored crcid + let crashCollection = CrashCollection.init(crashReportSender: CrashReportSender(platform: .iOS)) + crashCollection.clearCRCID() } } } From a1fef662788d6daa2bea1cad0a59668dcc3933d1 Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Thu, 12 Dec 2024 16:56:31 -0500 Subject: [PATCH 6/7] Crash report sending error pixels Support for sending error pixels when crash report submission fails or a CRCID is not returned by the server when expected. --- Core/PixelEvent.swift | 5 +++ DuckDuckGo.xcodeproj/project.pbxproj | 4 ++ DuckDuckGo/AppDelegate.swift | 4 +- .../CrashCollectionOnboardingViewModel.swift | 3 +- DuckDuckGo/CrashReportSenderExtensions.swift | 40 +++++++++++++++++++ DuckDuckGo/SettingsViewModel.swift | 2 +- 6 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 DuckDuckGo/CrashReportSenderExtensions.swift diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index b98773df96..8b656c3d59 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -505,6 +505,9 @@ extension Pixel { case dbCrashDetected case crashOnCrashHandlersSetUp + case crashReportCRCIDMissing // crashreporting_crcid-missing + case crashReportingSubmissionFailed // crashreporting_submission-failed + case dbMigrationError case dbRemovalError case dbDestroyError @@ -1367,6 +1370,8 @@ extension Pixel.Event { // MARK: debug pixels case .dbCrashDetected: return "m_d_crash" + case .crashReportCRCIDMissing: return "crashreporting_crcid-missing" + case .crashReportingSubmissionFailed: return "crashreporting_submission-failed" case .crashOnCrashHandlersSetUp: return "m_d_crash_on_handlers_setup" case .dbMigrationError: return "m_d_dbme" case .dbRemovalError: return "m_d_dbre" diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 453e70f3f0..4b40a51a96 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -219,6 +219,7 @@ 37FCAABC2992F592000E420A /* MultilineScrollableTextFix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FCAABB2992F592000E420A /* MultilineScrollableTextFix.swift */; }; 37FCAAC029930E26000E420A /* FailedAssertionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FCAABF29930E26000E420A /* FailedAssertionView.swift */; }; 37FD780F2A29E28B00B36DB1 /* SyncErrorHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37FD780E2A29E28B00B36DB1 /* SyncErrorHandler.swift */; }; + 46DD3D5A2D0A29F600F33D49 /* CrashReportSenderExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46DD3D592D0A29F400F33D49 /* CrashReportSenderExtensions.swift */; }; 4B0295192537BC6700E00CEF /* ConfigurationDebugViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B0295182537BC6700E00CEF /* ConfigurationDebugViewController.swift */; }; 4B0F3F502B9BFF2100392892 /* NetworkProtectionFAQView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B0F3F4F2B9BFF2100392892 /* NetworkProtectionFAQView.swift */; }; 4B274F602AFEAECC003F0745 /* NetworkProtectionWidgetRefreshModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B274F5F2AFEAECC003F0745 /* NetworkProtectionWidgetRefreshModel.swift */; }; @@ -1577,6 +1578,7 @@ 37FCAABF29930E26000E420A /* FailedAssertionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FailedAssertionView.swift; sourceTree = ""; }; 37FCAACB2993149A000E420A /* Waitlist */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Waitlist; sourceTree = ""; }; 37FD780E2A29E28B00B36DB1 /* SyncErrorHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncErrorHandler.swift; sourceTree = ""; }; + 46DD3D592D0A29F400F33D49 /* CrashReportSenderExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReportSenderExtensions.swift; sourceTree = ""; }; 4B0295182537BC6700E00CEF /* ConfigurationDebugViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurationDebugViewController.swift; sourceTree = ""; }; 4B0F3F4F2B9BFF2100392892 /* NetworkProtectionFAQView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionFAQView.swift; sourceTree = ""; }; 4B274F5F2AFEAECC003F0745 /* NetworkProtectionWidgetRefreshModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionWidgetRefreshModel.swift; sourceTree = ""; }; @@ -3783,6 +3785,7 @@ 37CF915E2BB4735F00BADCAE /* Crashes */ = { isa = PBXGroup; children = ( + 46DD3D592D0A29F400F33D49 /* CrashReportSenderExtensions.swift */, 37CF915F2BB4737300BADCAE /* CrashCollectionOnboarding.swift */, 37CF91612BB474AA00BADCAE /* CrashCollectionOnboardingView.swift */, 37CF91632BB4A82A00BADCAE /* CrashCollectionOnboardingViewModel.swift */, @@ -8109,6 +8112,7 @@ BDF8D0022C1B87F4003E3B27 /* NetworkProtectionDNSSettingsViewModel.swift in Sources */, 9838059F2228208E00385F1A /* PositiveFeedbackViewController.swift in Sources */, 8590CB67268A2E520089F6BF /* RootDebugViewController.swift in Sources */, + 46DD3D5A2D0A29F600F33D49 /* CrashReportSenderExtensions.swift in Sources */, 1DEAADEA2BA4539800E25A97 /* SettingsAppearanceView.swift in Sources */, B623C1C22862CA9E0043013E /* DownloadSession.swift in Sources */, 9F7CFF7F2C8A94F70012833E /* OnboardingView+AddressBarPositionContent.swift in Sources */, diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index d269146ab3..3d941e7035 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -81,7 +81,9 @@ import os.log private var syncStateCancellable: AnyCancellable? private var isSyncInProgressCancellable: AnyCancellable? - private let crashCollection = CrashCollection(crashReportSender: CrashReportSender(platform: .iOS)) + private let crashCollection = CrashCollection(crashReportSender: CrashReportSender(platform: .iOS, + pixelEvents: CrashReportSender.pixelEvents), + crashCollectionStorage: UserDefaults()) private var crashReportUploaderOnboarding: CrashCollectionOnboarding? private var autofillPixelReporter: AutofillPixelReporter? diff --git a/DuckDuckGo/CrashCollectionOnboardingViewModel.swift b/DuckDuckGo/CrashCollectionOnboardingViewModel.swift index c88ec3fbbb..5badf39bee 100644 --- a/DuckDuckGo/CrashCollectionOnboardingViewModel.swift +++ b/DuckDuckGo/CrashCollectionOnboardingViewModel.swift @@ -108,7 +108,8 @@ final class CrashCollectionOnboardingViewModel: ObservableObject { set { appSettings.crashCollectionOptInStatus = newValue if appSettings.crashCollectionOptInStatus == .optedOut { - let crashCollection = CrashCollection.init(crashReportSender: CrashReportSender(platform: .iOS)) + let crashCollection = CrashCollection.init(crashReportSender: CrashReportSender(platform: .iOS, + pixelEvents: CrashReportSender.pixelEvents)) crashCollection.clearCRCID() } } diff --git a/DuckDuckGo/CrashReportSenderExtensions.swift b/DuckDuckGo/CrashReportSenderExtensions.swift new file mode 100644 index 0000000000..a90e8d54da --- /dev/null +++ b/DuckDuckGo/CrashReportSenderExtensions.swift @@ -0,0 +1,40 @@ +// +// CrashReportSenderExtensions.swift +// DuckDuckGo +// +// Copyright © 2024 DuckDuckGo. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Crashes +import Common +import Core + +extension CrashReportSender { + + static let pixelEvents: EventMapping = .init { event, _, _, _ in + switch event { + case CrashReportSenderError.crcidMissing: + Pixel.fire(pixel: .crashReportCRCIDMissing) + + case CrashReportSenderError.submissionFailed(let error): + if let error { + Pixel.fire(pixel: .crashReportingSubmissionFailed, + withAdditionalParameters: ["HTTPStatusCode": "\(error.statusCode)"]) + } else { + Pixel.fire(pixel: .crashReportingSubmissionFailed) + } + } + } +} diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index 9b757ddb85..48e20b774f 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -355,7 +355,7 @@ final class SettingsViewModel: ObservableObject { get: { self.state.crashCollectionOptInStatus == .optedIn }, set: { if self.appSettings.crashCollectionOptInStatus == .optedIn && $0 == false { - let crashCollection = CrashCollection(crashReportSender: CrashReportSender(platform: .iOS)) + let crashCollection = CrashCollection(crashReportSender: CrashReportSender(platform: .iOS, pixelEvents: CrashReportSender.pixelEvents)) crashCollection.clearCRCID() } self.appSettings.crashCollectionOptInStatus = $0 ? .optedIn : .optedOut From bff8849a1ab8bfd6925b00139b44b8ef3fdd49f9 Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Mon, 16 Dec 2024 15:35:40 -0500 Subject: [PATCH 7/7] Removing unnecessary comments --- Core/PixelEvent.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index 8b656c3d59..ee2628e3d7 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -505,8 +505,8 @@ extension Pixel { case dbCrashDetected case crashOnCrashHandlersSetUp - case crashReportCRCIDMissing // crashreporting_crcid-missing - case crashReportingSubmissionFailed // crashreporting_submission-failed + case crashReportCRCIDMissing + case crashReportingSubmissionFailed case dbMigrationError case dbRemovalError