Skip to content

Conversation

@tomiir
Copy link
Collaborator

@tomiir tomiir commented Jan 15, 2026

Summary

Fixes broken WalletConnect Pay deep links in Telegram on Android by skipping URL encoding of the wcPayUrl parameter in that specific context. Telegram Android has issues handling double-encoded URLs, which was causing deep links to fail when using WalletConnect Pay.

Changes Made

  • CoreHelperUtil.ts: Added conditional check in appendPayToUri to skip encodeURIComponent when running in Telegram on Android
  • CoreHelperUtil.test.ts: Added 3 new test cases covering:
    • Telegram Android context (should NOT encode)
    • Telegram iOS context (should encode)
    • Non-Telegram Android context (should encode)

Testing

  • Added unit tests for the new behavior with all edge cases
  • All 30 CoreHelperUtil tests pass
  • Tests use mocked isTelegram() and isAndroid() to verify correct behavior across platform combinations

Test matrix:

Context Telegram Android Should Encode
Telegram Android
Telegram iOS
Browser Android
Browser Desktop

Related Issues

  • Fixes deep link issues for WalletConnect Pay in Telegram Mini Apps on Android

Additional Notes

  • This follows the same pattern used in formatNativeUrl which already double-encodes URIs specifically for Telegram Android
  • The fix is targeted to only affect Telegram Android; all other platforms continue to encode as expected
  • No breaking changes

Note

Fixes WalletConnect Pay deep links by adjusting URL handling for Telegram on Android.

  • Updates appendPayToUri in CoreHelperUtil.ts to bypass encodeURIComponent when isTelegram() and isAndroid() are true; otherwise continues encoding
  • Adds unit tests in CoreHelperUtil.test.ts covering Telegram Android (no encode), Telegram iOS (encode), and non-Telegram Android (encode), plus existing encoding cases (including special characters)

Written by Cursor Bugbot for commit 8f1c649. This will update automatically on new commits. Configure here.

Telegram Android has issues with double-encoded URLs. This fix skips
encoding the wcPayUrl in appendPayToUri when running in Telegram on
Android to prevent broken deep links.
Copilot AI review requested due to automatic review settings January 15, 2026 16:37
@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

⚠️ No Changeset found

Latest commit: 8f1c649

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 Jan 15, 2026

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

Project Deployment Review Updated (UTC)
appkit-basic-html Ready Ready Preview, Comment Jan 15, 2026 4:41pm
appkit-demo Ready Ready Preview, Comment Jan 15, 2026 4:41pm
appkit-gallery Ready Ready Preview, Comment Jan 15, 2026 4:41pm
appkit-headless-sample-app Ready Ready Preview, Comment Jan 15, 2026 4:41pm
appkit-laboratory Ready Ready Preview, Comment Jan 15, 2026 4:41pm
10 Skipped Deployments
Project Deployment Review Updated (UTC)
appkit-basic-example Ignored Ignored Jan 15, 2026 4:41pm
appkit-basic-sign-client-example Ignored Ignored Jan 15, 2026 4:41pm
appkit-basic-up-example Ignored Ignored Jan 15, 2026 4:41pm
appkit-ethers5-bera Ignored Ignored Jan 15, 2026 4:41pm
appkit-nansen-demo Ignored Ignored Jan 15, 2026 4:41pm
appkit-vue-solana Ignored Ignored Jan 15, 2026 4:41pm
appkit-wagmi-cdn-example Ignored Ignored Jan 15, 2026 4:41pm
ethereum-provider-wagmi-example Ignored Ignored Jan 15, 2026 4:41pm
next-wagmi-solana-bitcoin-example Ignored Ignored Jan 15, 2026 4:41pm
vue-wagmi-example Ignored Ignored Jan 15, 2026 4:41pm

Review with Vercel Agent

@github-actions
Copy link
Contributor

Visual Regression Test Results ✅ Passed

⚠️ 15 visual change(s) detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=650
Storybook Preview: https://6493191bf4b10fed8ca7353f-ocnczsiyvj.chromatic.com/

👉 Please review the visual changes in Chromatic and accept or reject them.

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 pull request fixes broken WalletConnect Pay deep links in Telegram on Android by preventing triple-encoding of the wcPayUrl parameter. The fix skips encoding in appendPayToUri when running in Telegram Android context, allowing the existing double-encoding logic in formatNativeUrl to handle encoding consistently.

Changes:

  • Modified appendPayToUri to skip URL encoding for the pay parameter in Telegram Android context
  • Added comprehensive test coverage for the platform-specific encoding behavior across different platform combinations

Reviewed changes

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

File Description
packages/controllers/src/utils/CoreHelperUtil.ts Added conditional logic to skip encoding the pay parameter when in Telegram Android context
packages/controllers/tests/utils/CoreHelperUtil.test.ts Added three test cases covering Telegram Android, Telegram iOS, and non-Telegram Android scenarios

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


// Avoid encoding in telegram android context
if (this.isTelegram() && this.isAndroid()) {
return `${wcUri}&pay=${wcPayUrl}`
Copy link

Choose a reason for hiding this comment

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

Unencoded pay URL breaks URI parsing in React hook

Medium Severity

The Telegram Android encoding skip in appendPayToUri works correctly when the result passes through formatNativeUrl (which double-encodes), but the useAppKitWallets React hook returns the URI directly without that transformation. If wcPayUrl contains & characters (e.g., ?id=123&amount=100), those ampersands won't be encoded on Telegram Android, causing them to be parsed as separate WC URI parameters rather than as part of the pay URL value.

Fix in Cursor Fix in Web

@github-actions
Copy link
Contributor

📦 Bundle Size Check

All bundles are within size limits

📊 View detailed bundle sizes

> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit


> size-limit

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         75.27 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 508 ms   on Snapdragon 410
Total time:   2 s
@reown/appkit/react
Size limit:   235 kB
Size:         233.09 kB with all dependencies, minified and gzipped
Loading time: 4.6 s     on slow 3G
Running time: 777 ms    on Snapdragon 410
Total time:   5.4 s
@reown/appkit/vue
Size limit:   80 kB
Size:         75.27 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 181 ms   on Snapdragon 410
Total time:   1.7 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         213.14 kB with all dependencies, minified and gzipped
Loading time: 4.2 s     on slow 3G
Running time: 409 ms    on Snapdragon 410
Total time:   4.6 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.16 kB with all dependencies, minified and gzipped
Loading time: 258 ms   on slow 3G
Running time: 44 ms    on Snapdragon 410
Total time:   301 ms

@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.65% 39401 / 50096
🔵 Statements 78.65% 39401 / 50096
🔵 Functions 76.33% 4245 / 5561
🔵 Branches 86.72% 9581 / 11048
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/controllers/src/utils/CoreHelperUtil.ts 74.5% 85.88% 64.13% 74.5% 22-23, 42, 67-68, 84, 88, 95-96, 112-113, 124, 147-148, 184, 200-201, 219-225, 255-256, 268-276, 323-328, 336, 352, 360, 362, 364-365, 375-380, 384-387, 397, 402, 407-413, 415, 476, 480-484, 493-496, 499-501, 505-520, 523-547, 550-554, 562, 437-455
Generated in workflow #16701 for commit 8f1c649 by the Vitest Coverage Report Action

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