Skip to content

fix(reporting): classify extension errors like the app reporter - #1046

Merged
bmc08gt merged 1 commit into
mainfrom
fix/extension-reporting-levels
Oct 13, 2026
Merged

bmc08gt merged 1 commit into
mainfrom
fix/extension-reporting-levels

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Bugsnag 6aa1f08 ("Notification preview prefetch failed") has 195 events across 29 users. The extension reporters in NotificationService/ExtensionReporting.swift and ShareExtension/ExtensionReporting.swift set severity = .error on everything, so suppressed ServerErrors such as ErrorGetMessages.transportFailure reached Bugsnag. About two-thirds of that day's events are CancellationError from the cancelled prefetch task, which is not a ServerError and would still have been reported as .error after a level check alone.

The pure decision now lives in FlipcashCore as ReportingOutcome (moved from ErrorReporting.Outcome). ReportingOutcome.resolve(error:) drops CancellationError, uses reportingLevel for ServerError, and treats anything else as .error. Both extension capture functions drop, or send at info or error severity, from that result. The app's ErrorReporting keeps Outcome as a typealias and outcome(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.

ReportingOutcomeTests in FlipcashCore pins suppressed and cancellation dropped, info staying info, unclassified as error, and the userFacing lift.

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.
@bmc08gt bmc08gt self-assigned this Oct 12, 2026
@bmc08gt
bmc08gt merged commit 44f6ec6 into main Oct 13, 2026
2 of 3 checks passed
@bmc08gt
bmc08gt deleted the fix/extension-reporting-levels branch October 13, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant