Repository navigation
fix(reporting): classify extension errors like the app reporter - #1046
Merged
Merged
Conversation
Both extension reporters sent every error at error severity and ignored ServerError.reportingLevel. ErrorGetMessages.transportFailure, which is .suppressed, reached Bugsnag as "Notification preview prefetch failed" (6aa1f08, 195 events / 29 users). About two-thirds of that day's events were CancellationError from the cancelled prefetch task, which is not a ServerError and would have fallen through as .error. Move the pure decision (Outcome and outcome(for:userFacing:)) into FlipcashCore as ReportingOutcome, and add resolve(error:) which also drops CancellationError. ExtensionReporting.capture in NotificationService and ShareExtension now drops, or sends at info or error severity, from that result. The app reporter delegates to the same type and keeps its behaviour.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugsnag 6aa1f08 ("Notification preview prefetch failed") has 195 events across 29 users. The extension reporters in
NotificationService/ExtensionReporting.swiftandShareExtension/ExtensionReporting.swiftsetseverity = .erroron everything, so suppressedServerErrors such asErrorGetMessages.transportFailurereached Bugsnag. About two-thirds of that day's events areCancellationErrorfrom the cancelled prefetch task, which is not aServerErrorand would still have been reported as.errorafter a level check alone.The pure decision now lives in FlipcashCore as
ReportingOutcome(moved fromErrorReporting.Outcome).ReportingOutcome.resolve(error:)dropsCancellationError, usesreportingLevelforServerError, and treats anything else as.error. Both extensioncapturefunctions drop, or send at info or error severity, from that result. The app'sErrorReportingkeepsOutcomeas a typealias andoutcome(for:userFacing:)as a wrapper, so its behaviour and tests are unchanged. The app reporter has no cancellation rule and is left alone; only the extensions drop cancellation.ReportingOutcomeTestsin FlipcashCore pins suppressed and cancellation dropped, info staying info, unclassified as error, and the userFacing lift.