Skip to content

fix: reduce calling auth connect to once when switching account type#4586

Merged
svenvoskamp merged 38 commits intomainfrom
fix/connectioncontroller-auth
Jun 30, 2025
Merged

fix: reduce calling auth connect to once when switching account type#4586
svenvoskamp merged 38 commits intomainfrom
fix/connectioncontroller-auth

Conversation

@svenvoskamp
Copy link
Copy Markdown
Contributor

Description

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 #...

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

svenvoskamp added 30 commits May 6, 2025 09:33
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jun 30, 2025

⚠️ No Changeset found

Latest commit: de6a59b

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
Copy Markdown

vercel bot commented Jun 30, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-basic-html ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 1:55pm
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 1:55pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2025 1:55pm
10 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-example ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
appkit-basic-up-example ⬜️ Ignored (Inspect) Visit Preview Jun 30, 2025 1:55pm
appkit-ethers5-bera ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
appkit-nansen-demo ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
appkit-vue-solana ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm
vue-wagmi-example ⬜️ Ignored (Inspect) Jun 30, 2025 1:55pm

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 30, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.69% 30717 / 39534
🔵 Statements 77.69% 30717 / 39534
🔵 Functions 68.59% 2531 / 3690
🔵 Branches 84.36% 6376 / 7558
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/controllers/src/controllers/ConnectionController.ts 80.71% 80.85% 52.87% 80.71% 160, 213-217, 220-224, 249-253, 262-281, 288, 296, 300, 304, 308, 312, 316, 320, 324, 355-356, 359-360, 395, 399, 433-435, 446-447, 482-483, 493-494, 496-497, 505-506, 508-509, 515-527, 368
packages/controllers/src/utils/SIWXUtil.ts 75.76% 70.31% 56.52% 75.76% 41-42, 46-47, 52-53, 59-72, 81-82, 85-86, 89-90, 93-94, 106-107, 142, 164-165, 167-168, 178-180, 183-198, 259, 300-327, 414-425, 303-333
Generated in workflow #13037 for commit de6a59b by the Vitest Coverage Report Action

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Auth Connector Fails Without Address

The handleActiveConnection method now incorrectly returns undefined for auth connectors when the address parameter is falsy. The refactored logic skips the connectExternal call for auth connectors, which previously provided a fallback mechanism to obtain a valid address, thus breaking the expected connection flow.

packages/controllers/src/controllers/ConnectionController.ts#L448-L467

if (!isAuthConnector) {
const connectData = await ConnectionController.connectExternal(
{
id: connector.id,
type: connector.type,
provider: connector.provider,
address,
chain: namespace
},
namespace
)
return connectData?.address
} else if (isAuthConnector && address) {
await ConnectionController.handleAuthAccountSwitch({ address, namespace })
}
return address
},

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@svenvoskamp svenvoskamp enabled auto-merge June 30, 2025 14:05
@svenvoskamp svenvoskamp added this pull request to the merge queue Jun 30, 2025
Merged via the queue into main with commit 0a184f0 Jun 30, 2025
41 checks passed
@svenvoskamp svenvoskamp deleted the fix/connectioncontroller-auth branch June 30, 2025 14:23
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.

2 participants