Skip to content

fix: prevent calling CONNECT_SUCCESS event for not connected namespaces with WC#4878

Merged
enesozturk merged 4 commits intomainfrom
enes/apkt-3631-in-multichain-examples-connect_success-events-being
Aug 20, 2025
Merged

fix: prevent calling CONNECT_SUCCESS event for not connected namespaces with WC#4878
enesozturk merged 4 commits intomainfrom
enes/apkt-3631-in-multichain-examples-connect_success-events-being

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

Description

When using WC connection on multi-chain instances, we are calling CONNECT_SUCCESS event for the not connected namespaces as well, which is wrong.

Reproduction Steps

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

Copilot AI review requested due to automatic review settings August 19, 2025 16:03
@linear
Copy link
Copy Markdown

linear bot commented Aug 19, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 19, 2025

⚠️ No Changeset found

Latest commit: f61d241

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 Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Aug 20, 2025 3:16pm
appkit-gallery Ready Ready Preview Comment Aug 20, 2025 3:16pm
appkit-laboratory Ready Ready Preview Comment Aug 20, 2025 3:16pm
11 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Aug 20, 2025 3:16pm
appkit-basic-sign-client-example Ignored Ignored Aug 20, 2025 3:16pm
appkit-basic-up-example Ignored Ignored Aug 20, 2025 3:16pm
appkit-ethers5-bera Ignored Ignored Aug 20, 2025 3:16pm
appkit-nansen-demo Ignored Ignored Aug 20, 2025 3:16pm
appkit-vue-solana Ignored Ignored Aug 20, 2025 3:16pm
appkit-wagmi-cdn-example Ignored Ignored Aug 20, 2025 3:16pm
ethereum-provider-wagmi-example Ignored Ignored Aug 20, 2025 3:16pm
next-wagmi-solana-bitcoin-example Ignored Ignored Aug 20, 2025 3:16pm
vue-wagmi-example Ignored Ignored Aug 20, 2025 3:16pm
appkit-demo Skipped Skipped Aug 20, 2025 3:16pm

@enesozturk enesozturk requested a review from a team August 19, 2025 16:03
Copy link
Copy Markdown
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

Fixes an issue where the CONNECT_SUCCESS event was being sent for all namespaces in multi-chain WalletConnect connections, even for namespaces that weren't actually connected. The fix ensures the event is only sent when an address is provided, indicating a successful connection.

  • Added address check to prevent sending CONNECT_SUCCESS events for unconnected namespaces
  • Enhanced test coverage for the finalizeWcConnection method
  • Bumped package version to reflect the fix

Reviewed Changes

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

File Description
packages/controllers/src/controllers/ConnectionController.ts Added address validation to only send CONNECT_SUCCESS event when connection actually succeeds
packages/appkit/tests/client/walletconnect-events.test.ts Added comprehensive tests to verify event sending behavior with and without address
packages/appkit/exports/constants.ts Version bump from 1.7.19 to 1.7.20

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 19, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.19% 34402 / 43995
🔵 Statements 78.19% 34402 / 43995
🔵 Functions 76.11% 3801 / 4994
🔵 Branches 86.74% 8142 / 9386
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/exports/constants.ts 100% 100% 100% 100%
packages/controllers/src/controllers/ConnectionController.ts 83.53% 81.37% 52.8% 83.53% 166, 224-228, 231-235, 264-268, 276-277, 284-303, 310, 318, 322, 326, 330, 334, 338, 342, 346, 350, 381-382, 385-386, 424, 428, 462-464, 475-476, 511-512, 522-523, 525-526, 534-535, 537-538, 557-558, 396
Generated in workflow #14436 for commit cd6eb08 by the Vitest Coverage Report Action

Comment thread packages/controllers/src/controllers/ConnectionController.ts
Copy link
Copy Markdown
Collaborator

@tomiir tomiir left a comment

Choose a reason for hiding this comment

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

Have you checked on core?

@enesozturk
Copy link
Copy Markdown
Contributor Author

Have you checked on core?

Yes, works fine

@enesozturk enesozturk enabled auto-merge August 20, 2025 13:21
@socket-security
Copy link
Copy Markdown

socket-security bot commented Aug 20, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​reown/​appkit-testing@​1.7.16 ⏵ 1.7.207910082 +198 +1100

View full report

@vercel vercel bot temporarily deployed to Preview – appkit-demo August 20, 2025 15:12 Inactive
@enesozturk enesozturk added this pull request to the merge queue Aug 20, 2025
Merged via the queue into main with commit 9efdbc5 Aug 20, 2025
59 of 60 checks passed
@enesozturk enesozturk deleted the enes/apkt-3631-in-multichain-examples-connect_success-events-being branch August 20, 2025 16:27
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