Skip to content

fix: Do not show error message if payWithExchange is not enabled#4908

Merged
tomiir merged 10 commits intomainfrom
fix/get_exchanges
Aug 26, 2025
Merged

fix: Do not show error message if payWithExchange is not enabled#4908
tomiir merged 10 commits intomainfrom
fix/get_exchanges

Conversation

@tomiir
Copy link
Copy Markdown
Collaborator

@tomiir tomiir commented Aug 26, 2025

Description

  • Fixes issue where error would appear if payWithExchange is not enabled.

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)

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: 1aa8a0a

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

This PR includes changesets to release 24 packages
Name Type
@reown/appkit-controllers 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 Patch
@reown/appkit-ui Patch
@reown/appkit-core Patch
@reown/appkit-utils Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-wallet-button Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-cdn Patch
@reown/appkit-universal-connector Patch
@reown/appkit-testing Patch
@reown/appkit-common Patch
@reown/appkit-polyfills Patch
@reown/appkit-wallet Patch
@reown/appkit-cli Patch
@reown/appkit-codemod 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 Aug 26, 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 26, 2025 11:03am
appkit-demo Ready Ready Preview Comment Aug 26, 2025 11:03am
appkit-gallery Ready Ready Preview Comment Aug 26, 2025 11:03am
appkit-laboratory Ready Ready Preview Comment Aug 26, 2025 11:03am
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Aug 26, 2025 11:03am
appkit-basic-sign-client-example Ignored Ignored Aug 26, 2025 11:03am
appkit-basic-up-example Ignored Ignored Aug 26, 2025 11:03am
appkit-ethers5-bera Ignored Ignored Aug 26, 2025 11:03am
appkit-nansen-demo Ignored Ignored Aug 26, 2025 11:03am
appkit-vue-solana Ignored Ignored Aug 26, 2025 11:03am
appkit-wagmi-cdn-example Ignored Ignored Aug 26, 2025 11:03am
ethereum-provider-wagmi-example Ignored Ignored Aug 26, 2025 11:03am
next-wagmi-solana-bitcoin-example Ignored Ignored Aug 26, 2025 11:03am
vue-wagmi-example Ignored Ignored Aug 26, 2025 11:03am

@lukaisailovic
Copy link
Copy Markdown
Collaborator

This is a bit weird, why do we have this.remoteFeatures?.payWithExchange. Pay with exchange is used with both payments and fund wallet. We should be checking fund wallet or payments key

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 26, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.3% 34786 / 44421
🔵 Statements 78.3% 34786 / 44421
🔵 Functions 76.18% 3833 / 5031
🔵 Branches 86.65% 8207 / 9471
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/controllers/src/controllers/ExchangeController.ts 92.98% 90.14% 81.25% 92.98% 75, 106-114, 119-120, 177, 266-274, 307
packages/scaffold-ui/src/views/w3m-fund-wallet-view/index.ts 90% 96.55% 85.71% 90% 35-36, 45-46, 62, 69-70, 102, 125, 143
Generated in workflow #14560 for commit 1aa8a0a by the Vitest Coverage Report Action

@tomiir tomiir marked this pull request as ready for review August 26, 2025 08:48
Copilot AI review requested due to automatic review settings August 26, 2025 08:48
@tomiir tomiir enabled auto-merge August 26, 2025 08:48
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

This PR fixes an issue where error messages would be shown when payWithExchange feature is not enabled. The fix adds conditional checks to prevent unnecessary API calls and error handling for disabled features.

  • Added conditional checks for payWithExchange feature enablement before calling exchange-related functionality
  • Modified fetchExchanges method to early return when payWithExchange is not enabled
  • Updated the fund wallet view to conditionally initialize exchange-related operations

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/scaffold-ui/src/views/w3m-fund-wallet-view/index.ts Added conditional logic to only set default payment asset and fetch exchanges when payWithExchange is enabled
packages/controllers/src/controllers/ExchangeController.ts Modified fetchExchanges method to early return when payWithExchange feature is not enabled
packages/controllers/tests/controllers/ExchangeController.test.ts Added test coverage for the new conditional behavior in fetchExchanges
.changeset/khaki-experts-yell.md Added changelog entry describing the fix

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

cursor[bot]

This comment was marked as outdated.

@tomiir
Copy link
Copy Markdown
Collaborator Author

tomiir commented Aug 26, 2025

@lukaisailovic it's a naming thing as that's what the flag is called cloud side.
Added payment related flags to the check 🫡

cursor[bot]

This comment was marked as outdated.

@tomiir tomiir added this pull request to the merge queue Aug 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2025
@tomiir tomiir merged commit 477eea4 into main Aug 26, 2025
41 checks passed
@tomiir tomiir deleted the fix/get_exchanges branch August 26, 2025 11:34
@github-actions github-actions bot mentioned this pull request Sep 9, 2025
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