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

fix: not allow multiple account syncs for same caip address #2547

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

zoruka
Copy link
Contributor

@zoruka zoruka commented Jul 16, 2024

Description

This PR is changing the syncAccount function over wagmi Web3Modal client to not allow the account data to be fetched twice for the same CAIP. This fixes the issue with account data being fetched multiple times between wagmi's watchAccount onChange callbacks.

Edit: This PR doesn't contain test coverage because the testing setup is a wip being done by @enesozturk.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

APKT-684

Showcase (Optional)

The change can be seen on here compared to live, when the account is connected and you refresh the page it updates a single the account info a single time.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections

Copy link

vercel bot commented Jul 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 18, 2024 3:38pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 18, 2024 3:38pm

@zoruka zoruka requested review from tomiir and enesozturk July 17, 2024 11:58
if (!isGetCallsStatusSupported()) {
return (
<Text fontSize="md" color="yellow">
Wallet does not support wallet_getCallsStatus rpc method
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Wallet does not support wallet_getCallsStatus rpc method
Wallet does not support the "wallet_getCallsStatus" RPC method

if (!isSendCallsSupported()) {
return (
<Text fontSize="md" color="yellow">
Wallet does not support wallet_sendCalls rpc method
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Wallet does not support wallet_sendCalls rpc method
Wallet does not support the "wallet_sendCalls" rpc method

if (supportedChains.length === 0) {
return (
<Text fontSize="md" color="yellow">
Account does not support atomic batch feature
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Account does not support atomic batch feature
Account does not support the atomic batch feature

@zoruka zoruka merged commit 4a242fa into main Jul 18, 2024
9 checks passed
@zoruka zoruka deleted the fix/multiple-account-syncs-on-wagmi branch July 18, 2024 16:07
@zoruka zoruka mentioned this pull request Jul 22, 2024
8 tasks
@tomiir tomiir mentioned this pull request Jul 24, 2024
4 tasks
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