Skip to content

fix: default account type after disconnect#4641

Merged
enesozturk merged 1 commit intomainfrom
enes/apkt-3161-bug-defaultaccounttypes-not-working-in-any-version
Jul 10, 2025
Merged

fix: default account type after disconnect#4641
enesozturk merged 1 commit intomainfrom
enes/apkt-3161-bug-defaultaccounttypes-not-working-in-any-version

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

@enesozturk enesozturk commented Jul 10, 2025

Description

When we disconnect the namespace, we are setting preferredAccountType of the account status to last used account type, where it should give priority to defaultAccountTypes option.

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

@linear
Copy link
Copy Markdown

linear bot commented Jul 10, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 10, 2025

🦋 Changeset detected

Latest commit: 11a858d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-testing Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 10, 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 Jul 10, 2025 9:56am
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 9:56am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 9:56am
10 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
appkit-basic-up-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
appkit-ethers5-bera ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
appkit-nansen-demo ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
appkit-vue-solana ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am
vue-wagmi-example ⬜️ Ignored (Inspect) Jul 10, 2025 9:56am

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: Undefined Access in OptionsController

Accessing OptionsController.state.defaultAccountTypes[chainToWrite] can cause a TypeError if defaultAccountTypes is undefined. This should be guarded with optional chaining (?.) or a null check to prevent runtime errors.

packages/controllers/src/controllers/ChainController.ts#L671-L672

const optionsAccountType = OptionsController.state.defaultAccountTypes[chainToWrite]

Fix in CursorFix in Web


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

@github-actions
Copy link
Copy Markdown
Contributor

Warnings
⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 92): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 92): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 243): 0xeeeeeeeeeeeeeeeeee...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 243): 0xeeeeeeeeeeeeeeeeee...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 92): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 253): So111111111111111111...

Generated by 🚫 dangerJS against 11a858d

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.79% 30701 / 39465
🔵 Statements 77.79% 30701 / 39465
🔵 Functions 68.8% 2528 / 3674
🔵 Branches 84.26% 6395 / 7589
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/exports/constants.ts 100% 100% 100% 100%
packages/controllers/src/controllers/ChainController.ts 78.76% 88.29% 74.72% 78.76% 179-190, 194-213, 217-227, 231-253, 275-276, 297-298, 386-393, 397-410, 417-418, 437-438, 452-453, 458-459, 462-463, 472-473, 478-479, 495-496, 514-515, 537-540, 561-568, 615-621, 634-635, 669-670, 723, 749-750, 789-790, 101, 197, 747
Generated in workflow #13291 for commit 11a858d by the Vitest Coverage Report Action

@enesozturk enesozturk requested a review from a team July 10, 2025 10:06
@enesozturk enesozturk added this pull request to the merge queue Jul 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 10, 2025
@enesozturk enesozturk added this pull request to the merge queue Jul 10, 2025
Merged via the queue into main with commit 9b7c7d0 Jul 10, 2025
58 of 59 checks passed
@enesozturk enesozturk deleted the enes/apkt-3161-bug-defaultaccounttypes-not-working-in-any-version branch July 10, 2025 11:22
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