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

Don't remove wallet account if storageAddress is undefined #595

Conversation

ebma
Copy link
Member

@ebma ebma commented Oct 14, 2024

I think this was caused by some kind of race condition that sometimes happens when switching the new tenant. I think it's fine to remove that call to fix the problem.

Closes #541.

This is to fix a bug where the wallet account is sometimes deleted
when switching between tenants
@ebma ebma linked an issue Oct 14, 2024 that may be closed by this pull request
Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for rococo-souffle-a625f5 ready!

Name Link
🔨 Latest commit 86903ee
🔍 Latest deploy log https://app.netlify.com/sites/rococo-souffle-a625f5/deploys/67250647f0924e0008b4417b
😎 Deploy Preview https://deploy-preview-595--rococo-souffle-a625f5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ebma ebma requested review from Sharqiewicz and a team October 14, 2024 16:48
@ebma
Copy link
Member Author

ebma commented Oct 14, 2024

@prayagd when testing the deploy preview, please also consider checking how the wallet connection behaves for wallet connect etc.

Copy link
Collaborator

@prayagd prayagd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested two different scenarios

  • If i connect only to Pendulum network then the connection breaks when switching to other chains, is this expected?
  • If i connect to all chains independently then the connection does not break
  • Wallet connect does not work, screenshot of console attached
Screenshot 2024-10-22 at 10 52 45 AM

@ebma
Copy link
Member Author

ebma commented Oct 23, 2024

If i connect only to Pendulum network then the connection breaks when switching to other chains, is this expected?

Hmm well I can reproduce that it breaks on the deploy preview. It worked for me locally though. I'll have a look again.

Wallet connect does not work, screenshot of console attached

Right, sorry. We need to whitelist all the domains on our walletconnect account. I whitelisted the domain of this deploy preview now so it should work. I'll let you know when I looked into the other bug again so you can test.

@ebma
Copy link
Member Author

ebma commented Oct 25, 2024

Troubleshooting this was way too annoying. I think I was able to pin it down though. The call to wallet.enable() here sometimes fails, ie. the await statement just doesn't resolve. This only happens on the deploy preview though. I found this ticket which is somehow similar. Adding a small timeout to the initialization of the wallet provider seems to alleviate the issue. I suppose it doesn't happen locally because the page is served faster and thus maybe the wallet provider is injected faster? I am not 100% sure what the problem is but neither are the maintainers in the talisman repo.

@prayagd please give it another shot and let me know if it works now.

src/GlobalStateProvider/index.tsx Outdated Show resolved Hide resolved
src/GlobalStateProvider/index.tsx Outdated Show resolved Hide resolved
src/GlobalStateProvider/index.tsx Outdated Show resolved Hide resolved
@ebma ebma requested a review from Sharqiewicz November 4, 2024 10:00
Copy link
Collaborator

@Sharqiewicz Sharqiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! ✅ It works. I hope Talisman will address this in the future, so we won’t need to rely on setTimeout, because using setTimeout is not ideal

@ebma ebma requested a review from prayagd November 4, 2024 10:39
@ebma
Copy link
Member Author

ebma commented Nov 4, 2024

@prayagd can you also try again and approve if it works?

Copy link
Collaborator

@prayagd prayagd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we can merge

@ebma ebma merged commit 6d23258 into main Nov 4, 2024
5 checks passed
@ebma ebma deleted the 541-wallet-connection-breaks-when-switching-from-pendulum-to-any-other-network branch November 4, 2024 10:47
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.

Wallet connection breaks when switching from Pendulum to any other network
3 participants