Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions src/utils/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,16 +622,26 @@ export async function performOAuthFlow(
? 'timeout'
: 'unknown';

analytics.captureException(error, {
step: 'oauth_flow',
oauth_error_code: oauthErrorCode,
oauth_error_description: flowError?.description,
client_id: clientId,
requested_scopes: config.scopes.join(' '),
// Collapse OAuth callback failures of the same kind into one issue
// instead of fragmenting by each user's install path in the stack trace.
$exception_fingerprint: `wizard_oauth_${oauthErrorCode}`,
});
if (accessDenied) {
// A user who clicks "Deny" made a deliberate choice, not an error.
// Record the cancellation as a plain event so we keep the rate
// without filing an exception for a normal outcome.
analytics.wizardCapture('oauth authorization cancelled', {
client_id: clientId,
requested_scopes: config.scopes.join(' '),
});
} else {
analytics.captureException(error, {
step: 'oauth_flow',
oauth_error_code: oauthErrorCode,
oauth_error_description: flowError?.description,
client_id: clientId,
requested_scopes: config.scopes.join(' '),
// Collapse OAuth callback failures of the same kind into one issue
// instead of fragmenting by each user's install path in the stack trace.
$exception_fingerprint: `wizard_oauth_${oauthErrorCode}`,
});
}

await abort();
throw error;
Expand Down
Loading