Skip to content

fix(error-reporting): import flutter_riverpod for .select extension#110

Merged
krazyjakee merged 2 commits into
masterfrom
fix/error-reporting-select-import
Jun 10, 2026
Merged

fix(error-reporting): import flutter_riverpod for .select extension#110
krazyjakee merged 2 commits into
masterfrom
fix/error-reporting-select-import

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

Problem

CI on master is failing at the flutter analyze step (run) after #109 merged:

error • The method 'select' isn't defined for the type 'SettingsControllerProvider' • lib/features/error_reporting/controllers/error_reporting.dart:66:34 • undefined_method

Cause

ErrorReportingController calls settingsControllerProvider.select(...) but only imported riverpod_annotation, which doesn't bring in the ProviderListenable.select extension. Every other controller using .select (channels, members, messages, users, emojis) imports flutter_riverpod alongside riverpod_annotation — this one was missing it.

Fix

Add the flutter_riverpod import. Verified flutter analyze --no-fatal-infos on the feature is now clean (only a pre-existing non-fatal unnecessary_import info remains).

🤖 Generated with Claude Code

krazyjakee and others added 2 commits June 11, 2026 00:36
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

Copy link
Copy Markdown
Contributor Author

Code Review — findings and fixes (commit ece2067)

✅ Primary fix (correct as-is)

The flutter_riverpod import addition is correct and sufficient. riverpod_annotation doesn't re-export ProviderListenable.select, so this was the only change needed to fix the CI failure. Consistent with every other controller that uses .select.


Findings and fixes applied

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

@krazyjakee krazyjakee merged commit 443270d into master Jun 10, 2026
1 check passed
@krazyjakee krazyjakee deleted the fix/error-reporting-select-import branch June 10, 2026 23:43
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.

2 participants