From ba86fced48cfc60375b1a0e7c049628733f8db4b Mon Sep 17 00:00:00 2001 From: Christopher Brind Date: Tue, 14 Nov 2023 18:19:10 +0000 Subject: [PATCH] remove return user pixel (#2146) --- Core/PixelEvent.swift | 4 ---- Core/ReturnUserMeasurement.swift | 31 ------------------------------- 2 files changed, 35 deletions(-) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index 057446861c..f2186f5827 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -360,9 +360,6 @@ extension Pixel { case remoteMessageSecondaryActionClicked case remoteMessageSheet - // MARK: Return user measurement - case returnUser - // MARK: debug pixels case dbCrashDetected @@ -1003,7 +1000,6 @@ extension Pixel.Event { 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" case .debugReturnUserReadATB: return "m_debug_return_user_read_atb" case .debugReturnUserUpdateATB: return "m_debug_return_user_update_atb" diff --git a/Core/ReturnUserMeasurement.swift b/Core/ReturnUserMeasurement.swift index 0dce183c42..f4a9507a08 100644 --- a/Core/ReturnUserMeasurement.swift +++ b/Core/ReturnUserMeasurement.swift @@ -45,9 +45,6 @@ class KeychainReturnUserMeasurement: ReturnUserMeasurement { } func installCompletedWithATB(_ atb: Atb) { - if let oldATB = readSecureATB() { - sendReturnUserMeasurement(oldATB, atb.version) - } writeSecureATB(atb.version) } @@ -88,34 +85,6 @@ class KeychainReturnUserMeasurement: ReturnUserMeasurement { } - private func readSecureATB() -> String? { - let query: [String: Any] = [ - kSecClass as String: kSecClassGenericPassword, - kSecAttrAccount as String: Self.SecureATBKeychainName, - kSecReturnData as String: kCFBooleanTrue!, - kSecMatchLimit as String: kSecMatchLimitOne - ] - - var dataTypeRef: AnyObject? - let status: OSStatus = SecItemCopyMatching(query as CFDictionary, &dataTypeRef) - if ![errSecSuccess, errSecItemNotFound].contains(status) { - fireDebugPixel(.debugReturnUserReadATB, errorCode: status) - } - - if let data = dataTypeRef as? Data { - return String(data: data, encoding: .utf8) - } - - return nil - } - - private func sendReturnUserMeasurement(_ oldATB: String, _ newATB: String) { - Pixel.fire(pixel: .returnUser, withAdditionalParameters: [ - PixelParameters.returnUserOldATB: oldATB, - PixelParameters.returnUserNewATB: newATB - ]) - } - private func fireDebugPixel(_ event: Pixel.Event, errorCode: OSStatus) { Pixel.fire(pixel: event, withAdditionalParameters: [ PixelParameters.returnUserErrorCode: "\(errorCode)"