Skip to content

feat: enrich oauth login failure telemetry for diagnosis#501

Merged
MattBro merged 1 commit into
mainfrom
matt/oauth-invalid-scope-telemetry
Jun 2, 2026
Merged

feat: enrich oauth login failure telemetry for diagnosis#501
MattBro merged 1 commit into
mainfrom
matt/oauth-invalid-scope-telemetry

Conversation

@MattBro
Copy link
Copy Markdown
Contributor

@MattBro MattBro commented Jun 2, 2026

Problem

On OAuth login failure the wizard captured a generic exception with no context beyond the error message. Because the stack trace includes each user's install path (local source checkout, npx cache, bundled dist), the same underlying failure fragmented into many separate Error Tracking issues, with each failed run reporting as a new anonymous user. That made OAuth failures hard to triage and impossible to alert on cleanly.

This matters because the platform's per-app OAuth scope ceiling can reject the wizard's requested scopes at /authorize with invalid_scope when an app's ceiling isn't seeded with everything the wizard asks for. When that happens, the wizard is the failing client but the telemetry doesn't say which client, which scopes, or why.

Changes

In performOAuthFlow's failure path, attach oauth_error_code (parsed from the callback error), client_id, and requested_scopes to the captured exception, and set a stable $exception_fingerprint (wizard_oauth_<code>) so failures of the same kind collapse into one issue regardless of where the wizard is installed. No change to the auth flow itself.

Test plan

  • pnpm build (typecheck + smoke test) and pnpm test pass; pnpm fix clean.
  • The enrichment is on the existing captureException call in the catch block; no new control flow.
  • Covered by CI.

Related

LLM context

Authored by Claude Code (Opus 4.8) as follow-up observability, paired with the server-side log linked above. region was intentionally not added (the wizard can't know it until after auth succeeds, and this fires pre-auth); the runbook link rides on the downstream alert rather than being hardcoded into source.

On OAuth callback failure the wizard captured a generic exception with no
context, and the resulting Error Tracking issues fragmented across each
user's install path in the stack trace, so the same failure showed up as
many low-signal issues. Attach oauth_error_code, client_id, and
requested_scopes, and set a stable $exception_fingerprint
(wizard_oauth_<code>) so failures of the same kind collapse into one
alertable issue.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@MattBro MattBro marked this pull request as ready for review June 2, 2026 17:53
Copy link
Copy Markdown
Collaborator

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks dude!

@MattBro MattBro merged commit e70f51b into main Jun 2, 2026
20 checks passed
@MattBro MattBro deleted the matt/oauth-invalid-scope-telemetry branch June 2, 2026 19:55
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