feat: implement Queue Management for Wallet Connection#642
Merged
RUKAYAT-CODER merged 2 commits intoJun 3, 2026
Merged
Conversation
Serialises concurrent wallet connection requests through a WalletConnectionQueue so that rapid successive connect() calls never fire multiple wallet pop-ups or produce conflicting state updates. - Add WalletConnectionQueue class (FIFO, stats, clear()) in src/utils/web3/walletQueue.ts with a shared singleton export - Route all connect() calls in useWeb3Wallet and WalletProvider through walletConnectionQueue.enqueue() - Expose queueStats from useWeb3Wallet for observability - Export queue types/singleton from the web3 barrel (utils/web3/index) - Add unit tests for WalletConnectionQueue - Add queue-related integration tests to useWeb3Wallet test suite Closes rinafcode#391
Contributor
|
Kindly resolve conflict and fix workflow. |
|
@Akanimoh12 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
Done |
Contributor
|
Thanks for your contribution. |
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
WalletConnectionQueueclass (src/utils/web3/walletQueue.ts) that serialises all wallet connection requests in FIFO order, preventing concurrent pop-ups and conflicting state updates.connect()call inuseWeb3WalletandWalletProviderthrough a shared singleton queue instance.queueStatsfromuseWeb3Walletso components can observe queue depth and processing state.src/utils/web3/barrel.Changes
src/utils/web3/walletQueue.tsWalletConnectionQueueclass + singletonsrc/utils/web3/index.tssrc/hooks/useWeb3Wallet.tsconnect()throughwalletConnectionQueue.enqueue(); exposequeueStatssrc/providers/WalletProvider.tsxconnect()through the same shared queuesrc/utils/__tests__/walletQueue.test.tssrc/hooks/__tests__/useWeb3Wallet.test.tsTesting Notes
WalletConnectionQueueunit tests cover: single success, single failure, FIFO serialisation, continue-after-failure,clear(), length/processing accessors.useWeb3Wallettests verifyqueueStatsshape and that concurrentconnect()calls are serialised.pnpm run type-check && pnpm run lint && pnpm run testAcceptance Criteria Checklist
Closes #391