Skip to content

Fix unsupported network detection and UI handling #351

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

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix Unsupported Network Detection and UI Handling

Issue

When a developer sets one network (e.g., Polygon Amoy) but wallets approve additional networks in "approvedNamespaces", AppKit doesn't properly handle this case, causing issues when the active chain is not in the requested networks list.

Changes

  • Added isActiveNetworkInRequestedNetworks() method to NetworkController to check if the active network is in the requested networks list
  • Updated NetworkButton component to show "Switch Network" when the active network is not supported
  • Modified UnsupportedChainView message to be more generic for all unsupported networks
  • Added network validation in the wagmi client to check if the active network is supported
  • Added tests for the new network validation functionality

Testing

  • Added unit tests for the new isActiveNetworkInRequestedNetworks() method
  • Verified all existing tests pass

Link to Devin run

https://app.devin.ai/sessions/124d739794074b339654fedc48a576d7

Requested by: [email protected]

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

changeset-bot bot commented May 22, 2025

⚠️ No Changeset found

Latest commit: b76f26d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ignaciosantise
Copy link
Collaborator

AccountDefaultView also has a network button that should follow the same behavior. IF not supported, it should show "Switch Network" and open the unsupported network view.

@ignaciosantise
Copy link
Collaborator

AccountView also has a network button that shows the icon only. In case of an unsupported network there, we should also open the unsupported network view when pressed

@ignaciosantise
Copy link
Collaborator

It is also good to open the Unsupported Network view as soon as we notice the case. Dont wait til the user presses the network button

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
44.2% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ B)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant