magic_sentry 0.0.1
magic_sentry: ^0.0.1 copied to clipboard
Sentry error and performance monitoring for the Magic Framework.
Changelog #
All notable changes to this project will be documented in this file.
[Unreleased] #
0.0.1 - 2026-09-27 #
Initial release.
Added #
MagicSentry.run: a zone-wrappedSentryFlutter.initboot, web-safe per flutter/flutter#100277, andMagicSentry.installErrorWidgetBreadcrumb, which tags a build error that replaced the interface.SentryServiceProvider<T>: wiresSentryNetworkInterceptorinto magic'sHttpdriver (withsentry_dio's own failed-request capture disabled to avoid double reporting), installsSentryUserContext<T>onAuth.stateNotifierwhen a host app suppliesuserId/userEmail, and registersSentryNavigatorObserveronMagicRouter. A failure wiring the interceptor is reported, throughLog.warningwith its stack trace whenlogis bound anddebugPrintotherwise, never swallowed.SentryNetworkInterceptor: reports a 5xx or a dead connection as an event fingerprinted by the normalised endpoint, a 4xx as a breadcrumb, and deduplicates repeats within a session.SentryUserContext<T>: keeps Sentry's scope user (id and email) and optional extra tags in step with the host app's ownAuthenticatablemodel.install()is idempotent: a second call adds no second listener.EventBreadcrumbs.breadcrumbFor: maps any dispatched event that implements magic'sReportsBreadcrumb(breadcrumbCategory,breadcrumbMessage,breadcrumbData) to a Sentry breadcrumb, and answers null for every other event.SentryServiceProvider.bootwires it throughEvent.listenAny, gated onSentry.isEnabledlike the provider's other hooks, and registers it once however many times it boots in one isolate. Any package or app event that opts in (magic_deeplink'sDeeplinkOpenedandDeeplinkNavigating, for example) shows up in the breadcrumb trail with no extra wiring. (lib/src/event_breadcrumbs.dart)assets/stubs/install/sentry_config.stub, published byinstall.yamlinto a consumer'slib/config/sentry.dartas an editable starting point: aconfigureSentryreadingSENTRY_DSN,SENTRY_ENVIRONMENT,SENTRY_RELEASEandSENTRY_TRACES_SAMPLE_RATEfrom.env. The barrel does not export a package copy of those names, so the documentedmain()imports them unambiguously from the app.- Requires
magic ^0.0.22, the first release withEvent.listenAnyandReportsBreadcrumb, andsentry_flutter/sentry_dio^9.27.0.