Skip to content

fix(leather-wallet): cache wallet connection with daily expiry and improve wallet reconnection reliability#36

Merged
chybisov merged 13 commits into
mainfrom
LF-16080-fix-leather-wallet
Nov 13, 2025
Merged

fix(leather-wallet): cache wallet connection with daily expiry and improve wallet reconnection reliability#36
chybisov merged 13 commits into
mainfrom
LF-16080-fix-leather-wallet

Conversation

@tomiiide
Copy link
Copy Markdown
Contributor

@tomiiide tomiiide commented Oct 13, 2025

Which Jira task is linked to this PR?

https://lifi.atlassian.net/browse/LF-16080

Relates to lifinance/widget#579

What was done

The problems

  1. Leather wallet does not persist dapp connections. While the connector saves connection state locally and attempts to reconnect via getAddresses() on refresh, the wallet itself is unaware of any previous connection and treats each call as a new connection request, resulting in a repeated popup for every page refresh.
  2. Leather Wallet reconnection would hang indefinitely when slow/problematic wallets (like Ctrl, Oyl) took too long to respond.

https://leather.gitbook.io/developers/methods/getaddresses#sandbox

The solutions

  1. Cache leather wallet connections with a daily expiry
  2. Added timeouts (5s) to prevent slow wallets from blocking the entire reconnection process
    • Parallel processing with immediate state updates - users see connections as they become available

@tomiiide tomiiide self-assigned this Oct 13, 2025
@tomiiide tomiiide changed the title fix(leather-wallet): disable shim disconnect by default fix(leather-wallet): cache wallet connection with daily expiry and fix wallet reconnection reliability Oct 15, 2025
@tomiiide tomiiide changed the title fix(leather-wallet): cache wallet connection with daily expiry and fix wallet reconnection reliability fix(leather-wallet): cache wallet connection with daily expiry and improve wallet reconnection reliability Oct 15, 2025
@tomiiide tomiiide requested review from chybisov and effie-ms October 16, 2025 10:52
Comment thread packages/client/src/actions/reconnect.ts
Comment thread packages/client/src/connectors/leather.ts
Comment thread packages/client/src/connectors/leather.ts Outdated
@tomiiide tomiiide requested a review from effie-ms October 22, 2025 11:09
@callMeTheQA
Copy link
Copy Markdown

@tomiiide can we merge/close this pr?

@chybisov chybisov merged commit fcff06e into main Nov 13, 2025
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