bug: Wallet disconnects on page refresh (no auto-reconnect) #8
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
After connecting Keplr wallet successfully, refreshing the page causes the wallet to disconnect. User must manually reconnect after every refresh.
Expected
Wallet should auto-reconnect on page refresh if Keplr is still authorized for the site.
Steps to Reproduce
Environment
Notes
May share root cause with #7 (wallet state not reaching swap page). Both point to wallet state not being persisted/restored properly.
Fix has been committed in
c77b96d— the wallet now auto-reconnects on page refresh.What changed (
frontend-dapp/src/hooks/useWallet.ts):walletName,walletType) are persisted tolocalStorage.@Brouie — can you verify this works on your end? Connect Keplr, refresh the page, and confirm the wallet stays connected. Leaving this open until verified.
mentioned in commit
c77b96d84fmentioned in issue #1
mentioned in issue #18
mentioned in commit b09808cd68252db560e2bfb1a5e1ccb079aff490
Fix pushed on branch
fix/issue-8-wallet-reconnect(commit b09808c).Root cause: The auto-reconnect code ran at module import time, before browser extension wallets (Keplr, Leap, etc.) had injected their API into
window. The connection attempt failed silently and the.catch()handler deleted thelocalStorageentry — making reconnection permanently impossible even after the extension finished loading.Fix (in
frontend-dapp/src/hooks/useWallet.ts):window.loadevent, when all extension content scripts are guaranteed to have injected their APIs.localStorageon permanent errors (user rejection, wallet not installed, unsupported wallet) — not on transient failures.@Brouie — requesting your review on this one.
mentioned in commit
2e6f54fd29Correction: the fix has been merged directly to
main(commit2e6f54f), not on a separate branch.Verified fixed — Keplr wallet persists after page refresh. Auto-reconnect with retry logic working. Note: simulated dev wallet does not persist (uses different connectDev path, not saved to localStorage).
mentioned in issue #49
mentioned in issue #50
mentioned in issue #155
mentioned in merge request !894
mentioned in issue #502
mentioned in issue #507