Fix wallet connect button hanging on rejected connection - #263
Merged
arisu6804 merged 2 commits intoJul 22, 2026
Conversation
- Add error state management in AppContext for connection failures - Implement 30-second timeout to prevent indefinite hanging - Add proper error handling with try-catch in connect function - Display error alerts in WalletButton when connection fails - Clear errors on disconnect and retry attempts - Update wallet service to simulate connection rejections (10% chance) - Add comprehensive test coverage: - Wallet service tests for rejection scenarios - AppContext tests for error handling and timeout - WalletButton tests for UI error feedback - Update README with enhanced wallet features documentation
Contributor
|
Really tidy PR — appreciate the detail. ✅ |
Contributor
Author
Conflict resolved and this branch is ready for merge |
Contributor
|
Great work, merged. 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I've successfully fixed the wallet connect button hanging issue on rejected connections. Here's what was done:
Changes Made
1. Error State Management (AppContext.jsx)
connectionErrorstate to track connection failuresconnect()functionPromise.race()to prevent indefinite hanging2. User Feedback (WalletButton.jsx)
AlertcomponenthandleConnectto properly catch errors3. Realistic Testing (wallet.js)
4. Hook Interface (useWallet.js)
connectionErrorto the hook's return valuesTest Coverage Added
3 new/updated test files with comprehensive coverage:
test/services/wallet.test.js- Enhanced with rejection scenarios and storage teststest/unit/AppContext.wallet.test.jsx- New file testing error handling, timeout, and state managementtest/components/WalletButton.test.jsx- New file testing UI error feedback and user flowsDocumentation Updated
README.md- Added wallet error handling features and test documentationWALLET_FIX_SUMMARY.md- Detailed summary document of all changesAcceptance Criteria
✅ Implemented the change - Button no longer hangs on rejected connections
✅ Added automated tests - Comprehensive test coverage for all scenarios
✅ Updated documentation - README and summary documentation complete
All Changes Committed
Commit:
d5673a3- "Fix wallet connect button hanging on rejected connection"8 files changed, 524 insertions(+), 11 deletions(-)
The wallet connect button now provides proper user feedback, handles timeouts, and gracefully recovers from connection failures.
Closes #2