Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Add comprehensive error handling tests for ConnectionController (APKT-2901)

Description

This PR adds comprehensive error handling tests for the ConnectionController, organized by error category:

  1. Connection Failures

    • WalletConnect connection failures
    • External wallet connection failures
    • Connection failures during wallet switching
  2. Timeout Scenarios

    • WalletConnect pairing timeouts
    • Transaction signing timeouts
    • Connection timeout handling
  3. Invalid Wallet Responses

    • Malformed wallet data handling
    • Unexpected response formats
    • Empty or null wallet responses
    • Invalid address formats
  4. Network Disconnections

    • Network disconnections during wallet operations
    • Disconnections during transaction signing/sending
    • Disconnect method failures
    • Session clearing failures
  5. Recovery Mechanisms

    • Auto-retry functionality
    • State reset and cleanup after errors
    • User-initiated recovery actions
    • Error boundary verification

Implementation Details

  • Used Vitest's mocking capabilities to simulate various error conditions
  • Added helper functions to verify error reporting and event sending
  • Used fake timers for timeout testing
  • Verified error boundary properly catches and processes errors
  • Tested error propagation through the error boundary
  • Verified UI error handling where applicable

Ticket

APKT-2901

Link to Devin run

https://app.devin.ai/sessions/92237a7e2e66477bb980b14b21efe222

Requested by

derek@reown.com

…ionController (APKT-2901)

Co-Authored-By: derek@reown.com <alexanderderekrein@gmail.com>
@linear
Copy link

linear bot commented May 17, 2025

@devin-ai-integration devin-ai-integration bot requested a review from arein May 17, 2025 21:27
@changeset-bot
Copy link

changeset-bot bot commented May 17, 2025

⚠️ No Changeset found

Latest commit: 578fb3c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented May 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-basic-html ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 1:27pm
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 1:27pm
appkit-gallery ✅ Ready (Inspect) Visit Preview Aug 1, 2025 1:27pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 1:27pm
11 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
appkit-basic-example ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
appkit-basic-up-example ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2025 1:27pm
appkit-ethers5-bera ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
appkit-nansen-demo ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
appkit-vue-solana ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm
vue-wagmi-example ⬜️ Ignored (Inspect) Aug 1, 2025 1:27pm

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77% 28883 / 37507
🔵 Statements 77% 28883 / 37507
🔵 Functions 68.41% 2430 / 3552
🔵 Branches 84.12% 5916 / 7032
File CoverageNo changed files found.
Generated in workflow #12529 for commit 8ac64a1 by the Vitest Coverage Report Action

…r tests

Co-Authored-By: derek@reown.com <alexanderderekrein@gmail.com>
Co-Authored-By: derek@reown.com <alexanderderekrein@gmail.com>
Co-Authored-By: derek@reown.com <alexanderderekrein@gmail.com>
@tomiir tomiir added this pull request to the merge queue May 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 22, 2025
@enesozturk
Copy link
Contributor

@devin-ai-integration can you resolve merge conflict?

…749-APKT-2901-connection-controller-error-tests
properties: { message: connectionError.message }
})

verifyEventSent(eventsSpy, 'CONNECT_ERROR')
Copy link

Choose a reason for hiding this comment

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

Bug: Test Error Handling for External Connections

The test for ConnectionController.connectExternal's error handling manually calls EventsController.sendEvent. It should instead verify that ConnectionController.connectExternal internally sends the CONNECT_ERROR event upon failure.

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.

4 participants