fix(error-reporting): import flutter_riverpod for .select extension#110
Merged
Conversation
The ErrorReportingController used settingsControllerProvider.select(...) but only imported riverpod_annotation, which doesn't provide the ProviderListenable.select extension — breaking `flutter analyze` and failing CI. Add the flutter_riverpod import, matching every other controller that uses .select. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…traction - Fix _parseDsn to strip legacy "key:secret" DSN secret from the X-Sentry-Auth header (use only the public key component). - Add GlitchTipClient unit tests covering DSN parsing (standard, legacy key:secret, path-prefixed, invalid), addBreadcrumb ring-buffer truncation, captureMessage/captureError HTTP payloads, and parseStackFrames regex (normal frames, async suspensions, blank input). https://claude.ai/code/session_01VQk2xt8oa1aZ3HCw4pcGGX
Contributor
Author
Code Review — findings and fixes (commit
|
| Severity | Location | Finding | Fix |
|---|---|---|---|
| Medium | glitchtip_client.dart:118 |
_parseDsn stored the full uri.userInfo as _dsnKey. For legacy Sentry DSNs with key:secret@host format, the X-Sentry-Auth header would send key:secret instead of the public key alone, causing auth failures. |
Changed to uri.userInfo.split(':').first to strip any secret component. |
| Medium | test/features/error_reporting/error_reporting_test.dart |
GlitchTipClient had no dedicated unit tests — the DSN parsing logic, ring-buffer eviction, HTTP payload shape, and parseStackFrames regex were all untested. |
Added 14 new tests covering: DSN init (standard, key:secret, path-prefixed, blank, missing project ID, bad scheme), addBreadcrumb ring-buffer truncation at maxBreadcrumbs, captureMessage/captureError HTTP payloads (via MockClient), and parseStackFrames (normal frames, async-suspension markers, blank input). |
No other issues found. File sizes are well under 1000 lines, no structural splits needed. No 3D model changes in this PR.
Generated by Claude Code
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.
Problem
CI on
masteris failing at theflutter analyzestep (run) after #109 merged:Cause
ErrorReportingControllercallssettingsControllerProvider.select(...)but only importedriverpod_annotation, which doesn't bring in theProviderListenable.selectextension. Every other controller using.select(channels, members, messages, users, emojis) importsflutter_riverpodalongsideriverpod_annotation— this one was missing it.Fix
Add the
flutter_riverpodimport. Verifiedflutter analyze --no-fatal-infoson the feature is now clean (only a pre-existing non-fatalunnecessary_importinfo remains).🤖 Generated with Claude Code