Skip to content

Conversation

@ieow
Copy link
Contributor

@ieow ieow commented Jan 19, 2026

Explanation

Adds a new generic SeedlessOnboardingError class to handle errors in the SeedlessOnboardingController that don't fit the more specific PasswordSyncError or RecoveryError classes.
Changes

  • Added SeedlessOnboardingError class with:
  • details property for additional debugging context beyond the error message
  • cause property to preserve the original error chain
  • toJSON() method for proper serialization in logging/error tracking systems

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

Introduces a generic, serializable error type and adopts it in authentication flow.

  • Adds SeedlessOnboardingError with details, cause handling (Error/string/object), and toJSON() for structured logging
  • Replaces generic throw in authenticate with SeedlessOnboardingError(AuthenticationError) preserving original error via cause
  • Exports SeedlessOnboardingError from package index
  • Adds comprehensive tests for error construction, serialization, and behavior

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

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

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.

cause:
this.cause instanceof Error
? { name: this.cause.name, message: this.cause.message }
: this.cause,
Copy link

Choose a reason for hiding this comment

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

Details lost in nested error serialization

Medium Severity

The toJSON method only serializes name and message from the cause property, losing the details property when the cause is itself a SeedlessOnboardingError. Since details provides "additional context about the error beyond the message" for debugging, this context is lost when errors are chained, undermining the debugging purpose of both the details and cause properties in logging and error tracking systems.

Fix in Cursor Fix in Web

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