Skip to content

Conversation

@glitch-txs
Copy link
Contributor

Description

  • Added conditionals for chain ID in Wagmi's connect function
  • Added defaultNetwork as part of the OptionsController state
  • Rename getDefaultNetwork to getLastActiveOrDefaultNetwork and added comments.

Please include a brief summary of the change.

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

For Linear issues: Closes APKT-xxx
For GH issues: closes #5365

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

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
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

…efaultNetwork as part of the OptionsController state, rename getDefaultNetwork to getLastActiveOrDefaultNetwork
Copilot AI review requested due to automatic review settings November 29, 2025 03:34
@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2025

⚠️ No Changeset found

Latest commit: 4b19d3b

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

@vercel
Copy link

vercel bot commented Nov 29, 2025

@glitch-txs is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Contributor

Thank you for your contribution! We ask that you please read and sign our CTA Document before we can accept your contribution. You can sign the CTA simply by posting a Pull Request Comment with the following text:


I have read the CTA Document and I hereby sign the CTA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes unwanted switchChain requests during EVM wallet connection by introducing a defaultNetwork configuration option that allows developers to specify the initial network for connection, preventing unnecessary chain switching.

Key Changes

  • Added defaultNetwork to OptionsController state to store the user's desired initial connection network
  • Renamed getDefaultNetwork to getLastActiveOrDefaultNetwork for clarity about its fallback behavior
  • Modified Wagmi adapter's connect method to use defaultNetwork from OptionsController instead of the chainId parameter

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/controllers/src/controllers/OptionsController.ts Added defaultNetwork state property and setDefaultNetwork method with JSDoc documentation
packages/controllers/tests/controllers/OptionsController.test.ts Added comprehensive tests for setDefaultNetwork functionality
packages/appkit/src/client/appkit-base-client.ts Renamed method for clarity and initialized defaultNetwork in OptionsController
packages/adapters/wagmi/src/client.ts Updated connect method to derive chainId from OptionsController.state.defaultNetwork for eip155 chains
packages/adapters/wagmi/src/tests/client.test.ts Added tests verifying chainId behavior with and without defaultNetwork

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

[bug] - several multi-chain issues.

1 participant