Skip to content

feat: add reconnecting state with automatic retry to wallet connection flow - #759

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
unlimitedengineer:feat/wallet-reconnect-752
Aug 24, 2026
Merged

feat: add reconnecting state with automatic retry to wallet connection flow#759
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
unlimitedengineer:feat/wallet-reconnect-752

Conversation

@unlimitedengineer

Copy link
Copy Markdown
Contributor

Closes #752

Summary

  • Adds useWalletReconnect hook that shows a spinner and 'Waiting for wallet…' label on the connect button after 3 seconds with no response from the wallet extension.
  • Automatically retries the connection request every 15 seconds up to a maximum of 3 retries.
  • After 3 failed retries shows a 'Could not connect — please try again' error message and resets the button state.
  • Clicking the connect button while in the waiting or retry state cancels the retry loop before starting a fresh connection attempt.
  • Updates ConnectWalletButton to wire up the new hook and render the spinner, waiting label, and failed error message.
  • Adds 19 unit tests covering all acceptance criteria: spinner threshold, retry interval, max retries, cancel behaviour, and error/success reset paths.

Test plan

  • Spinner and 'Waiting for wallet…' label appear after 3 seconds with no wallet response
  • Connection retries automatically every 15 seconds
  • After 3 retries the error message 'Could not connect — please try again' appears and the button resets
  • Clicking the connect button while waiting cancels the retry loop and starts a new attempt
  • All 19 unit tests for useWalletReconnect pass

@Chucks1093

Copy link
Copy Markdown
Member

The 3 second spinner threshold and the cancel on user click are both good UX decisions. One thing to consider going forward is surfacing the retry count to the user so they know the app is still working and not stuck. Something like showing attempt 2 of 3 next to the waiting label would give users more confidence before the final failure state appears.

@Chucks1093
Chucks1093 merged commit 1dee725 into accesslayerorg:dev Aug 24, 2026
1 check passed
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.

Add a reconnecting state to the wallet connection flow retrying automatically if the wallet extension is slow to respond

2 participants