Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple connector injected on Wallet Connect #4562

Closed
1 task done
aryan-alchemy opened this issue Feb 27, 2025 · 3 comments
Closed
1 task done

Multiple connector injected on Wallet Connect #4562

aryan-alchemy opened this issue Feb 27, 2025 · 3 comments
Labels
Needs Reproduction Misc: Needs Reproduction

Comments

@aryan-alchemy
Copy link

Check existing issues

Describe the bug

I am connecting an app through Metamask Extension. Now When I Connect using connect method in response of method it returns array of an accounts which has one entry. But when I see logs using watchConnections method there are two entries.

What happenes really is watchConnection calls twice when I click on Confirm from Extension, watchConnections triggers and returns one entry when connect method returns success it got triggered again and returns two connections entries however both entries are identical.

I noticed one thing, whenever wagmi.recentConnectorId is present in localstorage this issue happens, when I do refresh this variable got removed and i am getting only one connections in watchConnections.

Because of this issue, User needs to click on disconnect twice. I tried using latetse wagmi/core package but it still happens.

Here is my Metamask connector config and I am using an Angular 18:
export const metaMaskConnector = metaMask({ preferDesktop: true, extensionOnly: true })

Thanks and Regards,
Aryan

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

What Wagmi package(s) are you using?

@wagmi/core

Wagmi Package(s) Version(s)

2.10.5

Viem Version

2.9.32

TypeScript Version

No response

Anything else?

No response

@jxom jxom added the Needs Reproduction Misc: Needs Reproduction label Feb 27, 2025
Copy link
Contributor

Hello @aryan-alchemy.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2025
@aryan-alchemy
Copy link
Author

Hey @jxom Please check the issue here! [https://stackblitz.com/edit/stackblitz-starters-zacwasgz?file=src%2Fmain.ts]. Please check the console under name Account Coonections.

@aryan-alchemy
Copy link
Author

I also noticed that this bug is only present when you metaMask() as a connector. When you use injcted() for Metamask this issue is not there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants