🐛 Use startsWith for the wc:// check in the UriService#330
🐛 Use startsWith for the wc:// check in the UriService#330AlexV525 wants to merge 1 commit intoreown-com:developfrom
startsWith for the wc:// check in the UriService#330Conversation
There was a problem hiding this comment.
Pull request overview
Fixes overly broad WalletConnect deeplink detection in UriService by ensuring only URIs that start with wc:// are treated as the generic WalletConnect scheme (and therefore “not installed”), preventing false negatives for custom schemes like demowc://.
Changes:
- Replace
contains('wc://')withstartsWith('wc://')inUriService.isInstalledto avoid rejecting custom wallet schemes that includewc://later in the string.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -17,7 +17,7 @@ class UriService extends IUriService { | |||
| } | |||
|
|
|||
| // If the wallet is just a generic wc:// then it is not installed | |||
There was a problem hiding this comment.
The comment says this only filters out a "generic wc://", but the new condition returns false for any URI that starts with wc:// (including wc://<something>). Update the comment to match the actual behavior (e.g., clarify that any WalletConnect wc:// scheme is treated as not-installed).
| // If the wallet is just a generic wc:// then it is not installed | |
| // Treat any WalletConnect wc:// scheme URI as not installed |
| if (uri.startsWith('wc://')) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
This changes installation-detection behavior; please add a unit test covering both cases: wc://... returns false, while custom schemes that merely contain wc:// later in the string (e.g. demowc://) are not incorrectly rejected. This will prevent regressions of issue #329.
Description
Use
startsWithinstead ofcontainsto only escapewc://deeplink from the service.Resolves #329