Skip to content

fix: enable auto-connect by default; only the active tab reacts to wallet changes - #1549

Open
Ikari-Shinji-re wants to merge 1 commit into
mainfrom
fix/rc-577-enable-auto-connect-by-default
Open

Ikari-Shinji-re wants to merge 1 commit into
mainfrom
fix/rc-577-enable-auto-connect-by-default

Conversation

@Ikari-Shinji-re

Copy link
Copy Markdown
Member

Summary

Lets wallets auto-connect on every page and in every tab, while keeping swap execution limited to the active tab.

Queue manager reacts to wallets only in the active tab

  • Before: useQueueManager (rango-preset) reacted to wallet connects and disconnects in every tab (retryOn / unblock, checkWaitingForNetworkChange). A paused tab could change the saved state of a swap owned by the active tab.
  • useQueueManager now takes a required isActive:
    • Inactive tabs ignore wallet changes.
    • When a tab becomes active, swaps waiting for a wallet or network are checked again with the current wallet.
  • queue-manager-react's provider switches between paused and running in a useLayoutEffect, so the queue is already running when those checks happen.
  • Widget: useBootstrap passes isActive. The check that runs when saved swaps finish loading only runs in the active tab.

wallets-react always auto-connects

  • The autoConnect prop is removed. Auto-connect runs once blockchain meta has loaded.
  • Disconnecting always clears the saved wallet. Before, tabs where autoConnect was off skipped this.
  • The widget no longer passes autoConnect.

Swaps still run, and ask for signatures, only in the active tab. Every tab can now auto-connect; wallets with a loose canEagerConnect may show a popup per tab, and WalletConnect/TonConnect sessions are shared across tabs.

Breaking: useQueueManager requires isActive, and wallets-react's autoConnect prop is removed. In this repo only the widget used them.

Fixes # (issue)

How did you test this change?

  • Lint, type-check and build pass for queue-manager-react, queue-manager-rango-preset, wallets-react and widget-embedded
  • Unit tests pass for the changed packages (98, including wallets-react's auto-connect event tests)
  • Playground and widget app type-check
  • Manual: two tabs with a pending swap waiting for a wallet; connect a wallet in the inactive tab, then activate it and check the swap resumes only there
  • Manual: wallets reconnect after reload on a page without the widget (in app-v2)

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Implemented a user interface (UI) change, referencing our Figma design to ensure pixel-perfect precision.

This branch was successfully deployed

3 active deployments
playground-preview — 860f15c7 Deployed Nov 11, 2026 by Ikari-Shinji-re via playground-preview #5566
app-preview — 860f15c7 Deployed Nov 11, 2026 by Ikari-Shinji-re via app-preview #5566
preview — 860f15c7 Deployed Nov 11, 2026 by Ikari-Shinji-re via deploy #5566
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.

2 participants