-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: avoid throwing CONNECT_ERROR when connection request is rejected
#4992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: d4cd6d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
CONNECT_ERROR when connection request is rejectedCONNECT_ERROR when connection request is rejected
CONNECT_ERROR when connection request is rejectedCONNECT_ERROR when connection request is rejected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where CONNECT_ERROR events were incorrectly logged when users rejected connection requests. It introduces a new USER_REJECTED event type to properly distinguish user rejections from actual connection errors.
- Introduces new error handling utilities and
UserRejectedRequestErrorclass in the common package - Updates multiple connection flows to detect user rejection errors and emit
USER_REJECTEDevents instead ofCONNECT_ERROR - Adds comprehensive test coverage for the new error detection utilities
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/common/src/utils/ErrorUtil.ts | New error utility with user rejection detection and error classes |
| packages/common/tests/ErrorUtil.test.ts | Test coverage for new error utilities |
| packages/controllers/src/utils/withErrorBoundary.ts | Enhanced AppKitError class to track original error names |
| packages/controllers/src/utils/TypeUtil.ts | Added USER_REJECTED event type definition |
| packages/scaffold-ui/src/views/w3m-connecting-wc-view/index.ts | Updated error handling to emit USER_REJECTED for user rejections |
| packages/scaffold-ui/src/views/w3m-connecting-external-view/index.ts | Updated error handling to emit USER_REJECTED for user rejections |
| packages/scaffold-ui/src/partials/w3m-connecting-wc-browser/index.ts | Updated error handling to emit USER_REJECTED for user rejections |
| packages/appkit/src/utils/HelpersUtil.ts | Added WalletConnect specific user rejection error detection |
| packages/appkit/src/adapters/ChainAdapterBlueprint.ts | Enhanced connectWalletConnect with user rejection handling |
| packages/adapters/wagmi/src/client.ts | Updated connect methods to throw UserRejectedRequestError for user rejections |
| packages/adapters/solana/src/providers/WalletStandardProvider.ts | Updated connect to throw UserRejectedRequestError |
| packages/adapters/solana/src/providers/CoinbaseWalletProvider.ts | Updated connect to throw UserRejectedRequestError |
| packages/adapters/ethers5/src/client.ts | Wrapped connect method with user rejection error handling |
| packages/adapters/ethers/src/client.ts | Wrapped connect method with user rejection error handling |
| packages/adapters/bitcoin/src/adapter.ts | Updated connect to throw UserRejectedRequestError |
| .changeset/tall-sites-exist.md | Changeset documenting the fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
Fixed an issue where upon user connection rejection a
CONNECT_ERRORevent was logged. It now logs a new new event error calledUSER_REJECTEDType of change
Associated Issues
For Linear issues: Closes APKT-3748
Checklist