Skip to content

fix(error-reporting): point default DSN at GlitchTip project 2#122

Merged
krazyjakee merged 3 commits into
masterfrom
fix/crash-reporting-dsn-project-2
Jun 13, 2026
Merged

fix(error-reporting): point default DSN at GlitchTip project 2#122
krazyjakee merged 3 commits into
masterfrom
fix/crash-reporting-dsn-project-2

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

What

The baked-in default GlitchTip DSN targeted project 1 (https://…@crash.daccord.gg/1https://crash.daccord.gg/api/1/store/), so opt-in crash reports landed in the wrong project. This points it at the correct project 2 (cattrallgames) dashboard.

-    'https://8ca39e8b380a42548f2d8e9468d47ac2@crash.daccord.gg/1';
+    'https://f7c1b4791bdc42daac0b6411d41c8c4f@crash.daccord.gg/2';

Notes

  • Reporting remains opt-in — nothing is sent until the user enables errorReportingEnabled.
  • Tests use generic example DSNs and don't assert on the default constant, so no test changes are needed.
  • ⚠️ Action item outside this PR: release builds use the SENTRY_DSN GitHub secret if set (release.yml). If that secret still holds the old project-1 DSN, it will override this default. Update or clear it so release builds also report to project 2.

🤖 Generated with Claude Code

krazyjakee and others added 2 commits June 13, 2026 01:37
The baked-in default DSN targeted project 1 (/api/1/store/), so opt-in
crash reports landed in the wrong GlitchTip project. Point it at the
cattrallgames project 2 dashboard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add test that kDefaultGlitchTipDsn parses correctly and routes to
  project 2 (/api/2/store/), preventing silent regressions if the
  constant is changed back.
- Log HTTP 4xx/5xx responses from GlitchTip in debug mode so DSN
  misconfigurations surface during development without throwing.

https://claude.ai/code/session_01BTYgzQ7sY5prJYvxeeZrdc

Copy link
Copy Markdown
Contributor Author

Code Review — findings & fixes (commit 624bd9a)

The core one-line DSN change is correct and focused. Two improvements were pushed on top of it, ranked by severity:


🟡 Medium — Missing regression test for the DSN constant

Finding: The existing test 'the dev DSN is used when no dart-define override is set' only asserts resolveGlitchTipDsn() == kDefaultGlitchTipDsn — a tautology that passes regardless of the constant's value. If the DSN were silently reverted or typo'd to point at the wrong project, no test would catch it.

Fix applied: Added a new test that parses kDefaultGlitchTipDsn through GlitchTipClient.init() and asserts the derived store URL contains /api/2/store/:

test('kDefaultGlitchTipDsn is parseable and targets project 2', () {
  final c = GlitchTipClient();
  expect(c.init(kDefaultGlitchTipDsn), isTrue, reason: '...');
  expect(c.storeUrl, contains('/api/2/store/'), reason: '...');
});

This test would have caught the project-1 → project-2 bug this PR fixes.


🟢 Low — Silent HTTP 4xx/5xx failures in GlitchTipClient._sendEvent

Finding: _sendEvent discarded the HTTP response entirely. If the DSN key or project ID were wrong, every event would silently return a 401/404 with zero developer feedback — exactly the failure mode that motivated this PR.

Fix applied: The response is now captured; in debug mode, any 4xx/5xx logs to debugPrint with the store URL. The "never throw" invariant is preserved — the log is inside the existing try block, which swallows exceptions from post itself.

final response = await _http.post(...);
if (kDebugMode && response.statusCode >= 400) {
  debugPrint('[GlitchTip] event rejected: HTTP ${response.statusCode} (store URL: $_storeUrl)');
}

✅ No issues found

  • File size: both files are well under 1000 lines (controller: ~185 lines, client: ~210 lines, test: ~345 lines).
  • Code quality: scrubPiiText, _truncateId, breadcrumb ring-buffer, _hooksInstalled guard, and ref.onDispose teardown are all correct.
  • Opt-in invariant: confirmed — nothing is sent until errorReportingEnabled is true; the consent flags survive JSON round-trip (covered by existing tests).
  • Action item from PR description: the SENTRY_DSN GitHub secret should still be updated to the project-2 key if set — this is outside the scope of this code change.

Generated by Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@krazyjakee krazyjakee merged commit 05ae655 into master Jun 13, 2026
1 check passed
@krazyjakee krazyjakee deleted the fix/crash-reporting-dsn-project-2 branch June 13, 2026 00:48
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