From 2f921b1eb4262b6eb2990ad7a170ac4e59ae792b Mon Sep 17 00:00:00 2001 From: Jonathan Jackson Date: Mon, 9 Dec 2024 16:26:02 -0500 Subject: [PATCH] Prep for pixels to detect crash reporting failures --- Sources/Crashes/CrashCollection.swift | 4 ++-- Sources/Crashes/CrashReportSender.swift | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/Crashes/CrashCollection.swift b/Sources/Crashes/CrashCollection.swift index 65363c967..71d242abd 100644 --- a/Sources/Crashes/CrashCollection.swift +++ b/Sources/Crashes/CrashCollection.swift @@ -90,7 +90,6 @@ public final class CrashCollection { for payload in processedData { let result = await self.crashSender.send(payload, crcid: self.crcidManager.crcid) self.crcidManager.handleCrashSenderResult(result: result.result, response: result.response) - } didFinishHandlingResponse() } @@ -233,11 +232,12 @@ public class CRCIDManager { Logger.general.debug("Crash Collection - Received matching value for CRCID: \(receivedCRCID), no update necessary") } } else { + // TODO: Pixel: crashreporting_crcid-missing Logger.general.debug("Crash Collection - No value for CRCID header: \(CRCIDManager.crcidKey), clearing local crcid value if present") crcid = nil } case .failure(let failure): - // TODO: Is it worth sending a pixel for this case, so that we can monitor for missing crash reports? + // TODO: Pixel: crashreporting_submission-failed Logger.general.debug("Crash Collection - Sending Crash Report: failed (\(failure))") } } diff --git a/Sources/Crashes/CrashReportSender.swift b/Sources/Crashes/CrashReportSender.swift index fa2f42c89..e284460dc 100644 --- a/Sources/Crashes/CrashReportSender.swift +++ b/Sources/Crashes/CrashReportSender.swift @@ -56,7 +56,6 @@ public final class CrashReportSender: CrashReportSending { Logger.general.debug("CrashReportSender: Awaiting session data") let task = session.dataTask(with: request) { data, response, error in - // TODO: Consider pixels for failures that mean we may have lost crash info? if let response = response as? HTTPURLResponse { Logger.general.debug("CrashReportSender: Received HTTP response code: \(response.statusCode)") if response.statusCode == 200 {