magic_sentry 1.0.1
magic_sentry: ^1.0.1 copied to clipboard
Sentry for Magic apps: web-safe boot before Magic.init, HTTP failure reports, auth-synced user scope and URL token masking. Inert without a DSN.
Changelog #
All notable changes to this project will be documented in this file.
[Unreleased] #
1.0.1 - 2026-11-15 #
Fixed #
- The deeplink breadcrumb note names what the events carry, and the scrubber order is stated as the code runs it.
DeeplinkOpenedcarries the matched route pattern, the link's source and a names-tenant flag, andDeeplinkNavigatingthe route pattern only;scrubApiUrlmasks query values and route-bound tokens first, then runsnormalizeEndpoint, then masks any other opaque segment. The asides about whenMagicRouter.allRoutesandReportsBreadcrumbfirst shipped are gone from the installation and breadcrumb pages; the upgrade note for apps still onsentry_flutter9 stays. (doc/basics/event-breadcrumbs.md,doc/basics/http-reporting.md,doc/getting-started/installation.md) - The docs quote the SDK floor the package really has.
sentry_flutterandsentry_dioare^10.4.0, and Android needsminSdk24, not 26: 10.4.0 lowered it. iOS 15 and macOS 12 stand. (README.md,llms.txt,doc/getting-started/installation.md,skills/magic-sentry/SKILL.md) - The release-health note is scoped to web. A session needing named routes holds only on web, where
SentryNavigatorObserverstarts it; the docs no longer say it for every platform, and the install stub no longer claims a router with unnamed pages "reports zero sessions". (doc/getting-started/installation.md,llms.txt,assets/stubs/install/sentry_config.stub,example/lib/config/sentry.dart) - The install stub sample no longer awaits
MagicSentry.run, which returnsvoid. (assets/stubs/install/sentry_config.stub,example/lib/config/sentry.dart) - The token-grouping claim states its condition. A failed call groups under
/api/v1/invitations/{token}/acceptonly when the token is 32 or more[A-Za-z0-9_-]characters; a route rule does not match behind an/apiprefix. (doc/basics/http-reporting.md) - The README and skill samples analyse. The
Http.getcall sits in a function and the provider entry in aproviderslist with its imports. (README.md,skills/magic-sentry/SKILL.md)
Changed #
- The package page is
https://anilcancakir.com/magic/sentryand every documentation link sits underhttps://anilcancakir.com/magic/docs/sentry. (pubspec.yaml,README.md,llms.txt)
1.0.0 - 2026-11-14 #
Changed #
-
First stable release. Version 1.0.0 replaces the planned 0.1.0 and requires
magic ^1.0.0anddowel ^1.0.0; no API change beyond what is listed below. -
BREAKING: the SDK floor is Dart
>=3.13.0and Flutter>=3.47.0. Inherited frommagic1.0.0, which moved todowel,wind_kitandmaterial_ui. magic_sentry itself uses none of them; the example app importsmaterial_uiin place of Flutter's deprecatedmaterial.dart. The README,llms.txt, the agent skill and the installation guide quote the new floors andmagic^1.0.0. (pubspec.yaml,example/pubspec.yaml,example/lib/main.dart) -
Direct dependencies move to their latest releases.
sentry_flutterandsentry_dio^10.3.0to^10.4.0(also inexample/),test^1.25.0to^1.32.0. (pubspec.yaml,example/pubspec.yaml) -
The repository moved to
anilcancakir/magic_sentry.homepage(the package landing),repositoryandissue_trackerinpubspec.yamlpoint at the new owner, thedocumentationkey is gone (the landing links the docs, as for magic and wind), and the LICENSE holder is now Anılcan Çakır. The package name, the API and the version line are unchanged. (pubspec.yaml,LICENSE) -
The workflows and the README badge target
master. CI, the changelog check and the docs check run on pull requests tomaster. Every action is pinned by commit SHA and the workflows run with read-only permissions by default. (.github/workflows/) -
The publish workflow validates more and releases itself. The tag must sit on
masterand name the same version aspubspec.yamland the agent skill,flutter pub publish --dry-runand a pana run that must score 160 points pass, and a## [<version>]CHANGELOG section must exist before anything is published. The GitHub Release is then created from that section. (.github/workflows/publish.yml) -
The pub.dev description and topics are written for search and for agents. The description leads with the job ("Sentry for Magic apps") and the four things it does; the topics are
sentry,error-monitoring,crash-reporting,observabilityandmagic, andflutteris gone because pub.dev derives the SDK tag itself. (pubspec.yaml) -
The README follows the Magic plugin standard. It opens with the Magic logo and the centered header, then an
At a glancetable, one section per capability and aFor AI coding agentsrules table. (README.md,.github/magic-logo.svg) -
The analyzer no longer suppresses
unintended_html_in_doc_comment. The package analyzes clean without it. (analysis_options.yaml) -
Every change keeps the docs in step. The post-change checklist in
CLAUDE.mdand the pull request template require the changelog, README,llms.txt,doc/pages and the agent skill to match the change, and the release command now targetsmaster. (CLAUDE.md,.claude/commands/release.md) -
The install command and the installer references use the new names. The docs, the skill,
llms.txtand theinstall.yamlcomment saydart run magic:dowel plugin:install magic_sentry, a command that arrives with magic 1.0.0, and point at dowel for theinstall.yamlschema. (README.md,doc/,llms.txt,skills/magic-sentry/SKILL.md,install.yaml)
Added #
lib/cli.dartwithMagicSentryDowelProvider, soplugin:install magic_sentryregisters under dowel. It contributes no commands, stays Flutter-free, anddowel^1.0.0 is a new dependency. (lib/cli.dart,lib/src/cli/sentry_dowel_provider.dart,pubspec.yaml)doc/: seven pages in the repository's docs standard (installation, boot and the provider, HTTP reporting, user context, event breadcrumbs, token scrubbing and testing), checked bytool/check-docs.pyand a docs link check on every pull request. The installation guide moved here from a single page.llms.txt: the package for an AI coding agent, with setup, the API, platform support and the rules an agent must follow.skills/magic-sentry: an agent skill for the package, installed withnpx skills add anilcancakir/magic_sentry. It stays out of the pub.dev archive.example/: a runnable Magic app (web runner included) whosemain()isMagicSentry.run, with the provider registered, a button that files a test event and a button that fails an HTTP call to show the interceptor.SECURITY.md, a pull request template, issue forms that link the private vulnerability report and the API reference, and aChangelogcheck: a pull request that changeslib/,install.yamlorassets/stubs/must also changeCHANGELOG.md.
Fixed #
- The network interceptor test waits for the captured event instead of pumping the queue a fixed number of times.
captureEventis not awaited, so how many event loop turns it needs depends on the machine, and the test failed on the CI runners that tag1.0.0validated on. (test/sentry_token_scrubber_test.dart) - The docs and the post-install message return a
StringfromuserId.Model.idisdynamicand often anint, and an int id throws whenSentryUserContextinstalls, which takesMagic.initdown for a session restored at boot. The samples now writeuser.id?.toString() ?? ''and the pages carry a gotcha for it. (install.yaml,doc/,README.md,llms.txt,skills/magic-sentry/SKILL.md) SENTRY_RELEASEis documented as read from the bundled.env.Envdoes not read--dart-define, so the published config comment and the installation guide no longer say it does. (assets/stubs/install/sentry_config.stub,doc/getting-started/installation.md)- The scrubber's fail-closed note matches
sentry_flutter10. A throwing hook makes the SDK drop the event, breadcrumb or log, but send a streamed span half scrubbed; the scrubber keeps the report with the covered fields masked either way.MagicSentry.run's doc comment now listsbeforeSendSpanamong the hooks it wraps. (lib/src/sentry_token_scrubber.dart,lib/src/magic_sentry.dart) SentryUserContextassigns its extractors through initializing formals. Threeprefer_initializing_formalsinfos cost the package 10 pub.dev points. The constructor now uses Dart 3.12's private named parameters (required this._id); the public namesid,emailandextrasare unchanged. (lib/src/sentry_user_context.dart)
0.0.7 - 2026-11-10 #
BREAKING #
sentry_flutterandsentry_diomove to^10.3.0, and the minimum SDK to Dart 3.12 and Flutter 3.44. An app onsentry_flutter9 stays on 0.0.6. Version 10 also needs AndroidminSdk26 and iOS 15, and drops CocoaPods for Swift Package Manager; the app's ownSentryFlutter.initoptions must drop what 10 removed (enableLogs,enableMetrics,profilesSampleRate,enableStandaloneAppStartTracing) and givebeforeSendLogandbeforeSendMetrictheir secondHintparameter.
Added #
SentryTokenScrubber.beforeSendSpanmasks streamed spans.sentry_flutter10 sends each span as it finishes by default (SentryTraceLifecycle.stream) and builds no transaction, sobeforeSendTransactionnever ran and a span name or attribute carrying a token went out unscrubbed. The new hook applies the same rules to the spannameand to every string and string-array attribute, reads anhttpspan's name asMETHOD url, gives itsurl.fullthe opaque-segment rule of a transaction span'surland itshttp.querythe query rule, fails closed to[Filtered], andinstallruns it before the app's ownbeforeSendSpan.beforeSendTransactionstays for apps that chooseSentryTraceLifecycle.static. The wrappedbeforeSendLognow passes theHintthrough to the app's hook. (lib/src/sentry_token_scrubber.dart)
0.0.6 - 2026-11-07 #
Added #
SentryTokenScrubbermasks structured logs too. A log sent throughSentry.logger(withenableLogson) carried its body and attributes to Sentry unscrubbed, since the scrubber covered events, transactions and breadcrumbs only. The newSentryTokenScrubber.beforeSendLogapplies the same query-value and route-bound-token rules to the logbodyand to every string and string-array attribute, leaving number and boolean attributes alone, andinstall(soMagicSentry.run) now wrapsbeforeSendLogas well: the scrubber runs first and hands the scrubbed log to the app's own hook, sync or async, which may still drop it. It fails closed: the SDK catches a throwingbeforeSendLogand sends the original log, so on failure the body and every string attribute become[Filtered]instead. (lib/src/sentry_token_scrubber.dart,lib/src/magic_sentry.dart)
Changed #
MagicSentry.runcreatesSentryWidgetsFlutterBindinginstead ofWidgetsFlutterBinding.SentryFlutter.initinstalls Sentry's binding only when none exists, andruncreated Flutter's plain one first (it has to exist beforeEnv.loadreads the asset bundle), so frame tracking logged a warning and disabled itself in every app booted throughrun. The binding is still created at the same point, in the same zone. An app that callsWidgetsFlutterBinding.ensureInitialized()beforerunkeeps the plain binding and loses frame tracking. (lib/src/magic_sentry.dart)
0.0.5 - 2026-10-14 #
Added #
SentryTokenScrubberkeeps URL-borne tokens out of Sentry. On web the SDK setsrequest.urltowindow.locationand the transaction to the raw pathname, andsentry_diobreadcrumbs and spans keep the API path, so/invitations/<token>/acceptand/auth/reset-password?token=reached Sentry. The scrubber masks query values whose key containstoken,password,secret,signature,credentialorapi_key; path segments bound to a magic route param whose name containstoken(read fromMagicRouter.instance.allRoutes, so routes insideMagicRoute.group(layout: ...)count; needs magic 0.0.29, which adds it); and, onhttpbreadcrumb and span urls, any 32+ character[A-Za-z0-9_-]path segment that is not a UUID (numeric ids and the query stay). Hash-routed urls (https://host/#/invitations/<token>/accept) and a fragment that opens with a secret pair (#access_token=...) are covered. It coversrequest.url,request.queryString,request.fragment, the transaction name,contexts.trace, exception values, the event message, breadcrumbmessageanddata, and span descriptions and data. It only masks, never drops, and fails closed: if the scrubber throws, those fields are replaced with[Filtered]instead of letting the SDK send the half-scrubbed original.MagicSentry.runinstalls it afterconfigure, so it runs first inbeforeSend,beforeSendTransactionandbeforeBreadcrumband then hands its result to any hook the app set. (lib/src/sentry_token_scrubber.dart,lib/src/magic_sentry.dart,lib/magic_sentry.dart)
Changed #
magicfloor moves^0.0.28to^0.0.29. The token scrubber readsMagicRouter.allRoutes, which magic 0.0.29 introduces, so an adopter on an older magic now gets a version-solve error instead of a compile error inside this package. (pubspec.yaml)SentryNetworkInterceptorreports a scrubbed endpoint. The message, fingerprint andhttp_failurecontext of a captured failure now carrySentryTokenScrubber.scrubApiUrl, so an invitation call that fails with a 500 groups under/api/v1/invitations/{token}/acceptinstead of carrying the token.normalizeEndpointis production API now and loses its@visibleForTesting. (lib/src/sentry_network_interceptor.dart)
0.0.4 - 2026-10-13 #
Changed #
- Every sibling floor names this batch's release.
magicmoves^0.0.27to^0.0.28. The old range already admitted the new version, so a freshpub getresolves nothing differently; what changes is that the floor names the release this package is verified against. magic 0.0.28 is not breaking: it moves its own floors to artisan 0.0.20 and wind 1.8.4 and its devtools install pins, none of which this package calls. The issue template's magic version placeholder moves from0.0.22to0.0.28. (pubspec.yaml,.github/ISSUE_TEMPLATE/bug_report.yml)
0.0.3 - 2026-10-09 #
Changed #
- Every sibling floor names this batch's release.
magicmoves^0.0.24to^0.0.27. The old range already admitted the new version, so a freshpub getresolves nothing differently; what changes is that the floor names the release this package is verified against. None of magic 0.0.25 to 0.0.27 is breaking. (pubspec.yaml)
0.0.2 - 2026-09-29 #
Changed #
- Every sibling floor names this batch's release.
magicmoves^0.0.22to^0.0.24. The old range already admitted the new version, so a freshpub getresolves nothing differently; what changes is that the floor names the release this package is verified against. The real requirement is still 0.0.22, the first release withEvent.listenAnyandReportsBreadcrumb. magic 0.0.24 removesMagicController.onRefreshUI(BREAKING); this package calls it nowhere inlib/ortest/, so nothing here moves with it. (pubspec.yaml) - The README and the installation guide name the event breadcrumbs and the magic requirement. The README lists
ReportsBreadcrumbevents among what the plugin reports, and its layout namesevent_breadcrumbs.dart; the installation guide states magic 0.0.22 or higher and why. (README.md,doc/getting-started/installation.md) - The published archive leaves out the repository's tooling. A
.pubignorekeeps.claude/,CLAUDE.md,.github/and IDE folders out of the archive. A.pubignorereplaces.gitignorefor pub rather than adding to it, so it also names the local-only files.gitignorecovered (pubspec_overrides.yaml,pubspec.lock,coverage/,.env). (.pubignore)
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.