From 23ede26d34e3813b9fac626c902ca98a74f7cf99 Mon Sep 17 00:00:00 2001 From: Ben Dean-Kawamura Date: Fri, 10 Jul 2026 14:11:26 -0400 Subject: [PATCH] Bug 2050966 - Remove stale code in RustComponentsErrorTelemetry.kt Nowadays we're using the Rust error ping which is handled internally in the Kotlin module. We no longer need to forward these events for recording in sentry. The android side of this was removed in https://bugzilla.mozilla.org/show_bug.cgi?id=1991443. --- .../RustComponentsErrorTelemetry.kt | 55 ------------------- 1 file changed, 55 deletions(-) diff --git a/components/support/error/android/src/main/java/mozilla/appservices/errorsupport/RustComponentsErrorTelemetry.kt b/components/support/error/android/src/main/java/mozilla/appservices/errorsupport/RustComponentsErrorTelemetry.kt index 4f887c2ff0..722e974e3e 100644 --- a/components/support/error/android/src/main/java/mozilla/appservices/errorsupport/RustComponentsErrorTelemetry.kt +++ b/components/support/error/android/src/main/java/mozilla/appservices/errorsupport/RustComponentsErrorTelemetry.kt @@ -57,13 +57,6 @@ internal data class TracingErrorFields( val breadcrumbs: String, ) -@Serializable -internal data class TracingBreadcrumbFields( - val module: String, - val line: UInt, - val column: UInt, -) - private class ErrorEventSink : EventSink { val json = Json { ignoreUnknownKeys = true } @@ -74,54 +67,6 @@ private class ErrorEventSink : EventSink { RustComponentErrors.details.set(event.message) RustComponentErrors.breadcrumbs.set(fields.breadcrumbs.split("\n")) Pings.rustComponentErrors.submit() - - ApplicationErrorReporterRegistry.errorReporter?.reportError(fields.typeName, event.message) - } else if (event.target == "app-services-error-reporter::breadcrumb") { - val fields = json.decodeFromString(event.fields) - - ApplicationErrorReporterRegistry.errorReporter?.reportBreadcrumb( - event.message, - fields.module, - fields.line, - fields.column, - ) } } } - -/** - * Report Rust errors to Sentry (supplied by the application - * - * This represents the legacy error reporting interface. We're keeping this around for now so that - * Android can send errors to Sentry. At some point we should migrate Android to only use - * Glean-based error reporting. - */ -public interface ApplicationErrorReporter { - /** - * Report an error - */ - fun reportError(typeName: String, message: String) - - /** - * Report a breadbcrumb - */ - fun reportBreadcrumb(message: String, module: String, line: UInt, column: UInt) -} - -/** - * Set the global ApplicationErrorReporter - */ -public fun setApplicationErrorReporter(errorReporter: ApplicationErrorReporter) { - ApplicationErrorReporterRegistry.errorReporter = errorReporter -} - -/** - * Unset the global ApplicationErrorReporter - */ -public fun unsetApplicationErrorReporter() { - ApplicationErrorReporterRegistry.errorReporter = null -} - -internal object ApplicationErrorReporterRegistry { - var errorReporter: ApplicationErrorReporter? = null -}