-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: skip pay URL encoding in Telegram Android context #5472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
Visual Regression Test Results ✅ PassedChromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=650 👉 Please review the visual changes in Chromatic and accept or reject them. |
There was a problem hiding this 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
appendPayToUrito 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}` |
There was a problem hiding this comment.
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.
📦 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 |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Summary
Fixes broken WalletConnect Pay deep links in Telegram on Android by skipping URL encoding of the
wcPayUrlparameter 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 inappendPayToUrito skipencodeURIComponentwhen running in Telegram on AndroidCoreHelperUtil.test.ts: Added 3 new test cases covering:Testing
CoreHelperUtiltests passisTelegram()andisAndroid()to verify correct behavior across platform combinationsTest matrix:
Related Issues
Additional Notes
formatNativeUrlwhich already double-encodes URIs specifically for Telegram AndroidNote
Fixes WalletConnect Pay deep links by adjusting URL handling for Telegram on Android.
appendPayToUriinCoreHelperUtil.tsto bypassencodeURIComponentwhenisTelegram()andisAndroid()are true; otherwise continues encodingCoreHelperUtil.test.tscovering 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.