Skip to content

Conversation

@mathieuartu
Copy link
Contributor

@mathieuartu mathieuartu commented Jan 26, 2026

Explanation

Related to: MetaMask/metamask-extension#37080

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Improves reliability of auth SDK by centralizing error handling and covering non‑JSON server errors.

  • Add throwServiceError helper (with getResponseErrorMessage and isErrorResponse) to standardize HTTP/network error handling, including Retry-After parsing for 429
  • Refactor getNonce, authenticate, authorizeOIDC, pairIdentifiers, and getUserProfileLineage to use the new helper and return domain-specific errors with consistent messages
  • Add extensive tests for URLs, JSON/non-JSON error bodies, edge cases (null/undefined thrown values), and rate limiting
  • Update CHANGELOG.md to document the change

Written by Cursor Bugbot for commit 2f175fc. This will update automatically on new commits. Configure here.

@mathieuartu mathieuartu requested review from a team as code owners January 26, 2026 10:42
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@ccharly ccharly changed the title Handle non-JSON error responses in authentication services fix(profile-sync-controller): handle non-JSON error responses in authentication services Jan 26, 2026
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