Skip to content
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

[#20150] feat: wallet connect pairing via deep links #21050

Merged
merged 4 commits into from
Sep 3, 2024
Merged

Conversation

mohsen-ghafouri
Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri commented Aug 14, 2024

fixes #20150

Summary

As a user, I want to pair with the wallet via deeplinks, so that I can interact with the dApps I have on my phone.

Areas that maybe impacted

  • Dapps connection with deep link

Steps to test

  • Open https://lab.web3modal.com/library/wagmi-siwe/
  • Click the "Custom Wallet" button and add a custom name, in Mobile Linking type "status-app://"
  • Click the "Add Wallet"
  • Click the "Connect Wallet" button and choose the status wallet
  • It should automatically open and redirect to your wallet.

Result

Simulator.Screen.Recording.-.iPhone.13.-.2024-08-19.at.19.22.18.mp4

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 14, 2024

Jenkins Builds

Click to see older builds (20)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5dc907b #2 2024-08-14 16:56:35 ~4 min tests 📄log
✔️ 5dc907b #2 2024-08-14 16:58:23 ~6 min android 🤖apk 📲
✔️ 5dc907b #2 2024-08-14 16:59:32 ~7 min android-e2e 🤖apk 📲
✔️ 5dc907b #2 2024-08-14 17:06:54 ~15 min ios 📱ipa 📲
✔️ 572ace4 #3 2024-08-15 10:36:09 ~4 min tests 📄log
✔️ 572ace4 #3 2024-08-15 10:39:11 ~7 min android-e2e 🤖apk 📲
✔️ 572ace4 #3 2024-08-15 10:39:40 ~7 min android 🤖apk 📲
✔️ 572ace4 #3 2024-08-15 10:48:49 ~17 min ios 📱ipa 📲
✔️ e6783e8 #4 2024-08-19 16:53:40 ~4 min tests 📄log
✔️ e6783e8 #4 2024-08-19 16:57:29 ~8 min android-e2e 🤖apk 📲
✔️ e6783e8 #4 2024-08-19 16:57:58 ~9 min android 🤖apk 📲
✔️ e6783e8 #4 2024-08-19 17:05:23 ~16 min ios 📱ipa 📲
✔️ 0f85f61 #5 2024-08-22 20:07:51 ~4 min tests 📄log
✔️ 0f85f61 #5 2024-08-22 20:09:45 ~6 min android 🤖apk 📲
✔️ 0f85f61 #5 2024-08-22 20:10:40 ~7 min android-e2e 🤖apk 📲
✔️ 0f85f61 #5 2024-08-22 20:13:07 ~9 min ios 📱ipa 📲
✔️ b66712c #6 2024-08-22 22:38:07 ~4 min tests 📄log
✔️ b66712c #6 2024-08-22 22:41:55 ~8 min android-e2e 🤖apk 📲
✔️ b66712c #6 2024-08-22 22:42:19 ~9 min android 🤖apk 📲
✔️ b66712c #6 2024-08-22 22:43:07 ~10 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
9aa96a0 #7 2024-09-02 11:25:12 ~3 min tests 📄log
✔️ 9aa96a0 #7 2024-09-02 11:30:41 ~8 min android-e2e 🤖apk 📲
✔️ 9aa96a0 #7 2024-09-02 11:31:01 ~9 min android 🤖apk 📲
✔️ 9aa96a0 #7 2024-09-02 11:32:00 ~9 min ios 📱ipa 📲
✔️ a4cae86 #8 2024-09-03 07:44:51 ~4 min tests 📄log
✔️ a4cae86 #8 2024-09-03 07:48:58 ~8 min android-e2e 🤖apk 📲
✔️ a4cae86 #8 2024-09-03 07:49:21 ~9 min android 🤖apk 📲
✔️ a4cae86 #8 2024-09-03 07:49:58 ~9 min ios 📱ipa 📲

@mohsen-ghafouri mohsen-ghafouri force-pushed the feat/wc-deeplink branch 2 times, most recently from 572ace4 to e6783e8 Compare August 19, 2024 16:48
@mohsen-ghafouri mohsen-ghafouri marked this pull request as ready for review August 19, 2024 16:54
@mohsen-ghafouri mohsen-ghafouri requested review from clauxx, shivekkhurana and alwx and removed request for clauxx and shivekkhurana August 19, 2024 16:54
@mohsen-ghafouri
Copy link
Contributor Author

I would appreciate any suggestion about how we can test app with installed dapps, in this website https://lab.web3modal.com/library/wagmi-siwe/ there is an option to add custom wallet but in example native app there is no such option.

@clauxx
Copy link
Member

clauxx commented Aug 20, 2024

I would appreciate any suggestion about how we can test app with installed dapps, in this website https://lab.web3modal.com/library/wagmi-siwe/ there is an option to add custom wallet but in example native app there is no such option.

We should submit it to the WalletConnect cloud so it's available in the explorer (https://walletconnect.com/explorer-guidelines). @jakubgs can we get access to the project to submit the app? Also, did we do this before with v1?

@mohsen-ghafouri
Copy link
Contributor Author

mohsen-ghafouri commented Aug 20, 2024

@clauxx I can see old status app here https://explorer.walletconnect.com/status, the deeplink schema is the same(status-app://) we only need to update icon, and test it with release version maybe?

Copy link
Member

@clauxx clauxx left a comment

Choose a reason for hiding this comment

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

Have a few "stylistic" comments, but otherwise looks good!

Comment on lines 137 to 138
(when platform/android?
(rf/dispatch [:wallet-connect/redirect-to-dapp]))
Copy link
Member

Choose a reason for hiding this comment

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

did you try it on iOS as well? I wonder what happens when we try to open the dapp.

Copy link
Contributor Author

@mohsen-ghafouri mohsen-ghafouri Aug 20, 2024

Choose a reason for hiding this comment

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

I first tested it with url and it was working fine in both platform but with native as i couldn't test it with installed app still don't know.
I may create a simple dapp to test logic if it doesn't take time

Copy link
Member

Choose a reason for hiding this comment

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

I may create a simple dapp to test logic if it doesn't take time

This may be too time consuming I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i thought too, another option is to build app in release mode and test it with https://explorer.walletconnect.com/status, will let you know if it works fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the platform condition to have chance to test it with both platform, if in iOS it cause any issue i will disable it, in wallet connect doc it didn't mention any issue about iOS, lets see

@jakubgs
Copy link
Member

jakubgs commented Aug 22, 2024

@clauxx yes, we have a WalletConnect project created over 2 years ago:

image

@clauxx
Copy link
Member

clauxx commented Aug 22, 2024

@clauxx yes, we have a WalletConnect project created over 2 years ago:

image

Do you know what's with the draft tag below it?

@mohsen-ghafouri
Copy link
Contributor Author

We need to have access to wallet connect to correct status app info, I build android in release mode and it didn't work with status configuration in wallet connect

@pavloburykh
Copy link
Contributor

Hey @mohsen-ghafouri! Thanks for the PR. Could you please resolve the conflicts and rebase the branch? Thank you.

@clauxx
Copy link
Member

clauxx commented Sep 2, 2024

We need to have access to wallet connect to correct status app info, I build android in release mode and it didn't work with status configuration in wallet connect

gotta check what's the bundle identifier in the cloud

@mohsen-ghafouri
Copy link
Contributor Author

Hey @pavloburykh, thanks for checking this, done.

@status-im-auto
Copy link
Member

71% of end-end tests have passed

Total executed tests: 7
Failed tests: 2
Expected to fail tests: 0
Passed tests: 5
IDs of failed tests: 727230,702843 

Failed tests (2)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 2: `Text` is `0.04459 ETH`
    Device 1: `Text` is `0.44452 ETH`

    critical/test_wallet.py:190: in test_wallet_send_asset_from_drawer
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Sender balance is not updated on Etherscan, it is 0.4445 but expected to be 0.4446
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 1: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'Message BEFORE edit')]
    Device 1: Long press on Text until expected element is shown

    critical/chats/test_public_chat_browsing.py:373: in test_community_message_edit
        self.channel_1.edit_message_in_chat(message_before_edit, message_after_edit)
    ../views/chat_view.py:1015: in edit_message_in_chat
        self.chat_element_by_text(message_to_edit).message_body.long_press_until_element_is_shown(element)
    ../views/base_element.py:331: in long_press_until_element_is_shown
        action.long_press(element).release().perform()
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/common/touch_action.py:174: in perform
        self._driver.execute(Command.TOUCH_ACTION, params)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     The element 'By.xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'Message BEFORE edit')]' is not linked to the same object in DOM anymore; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
    E   Stacktrace:
    E   io.appium.uiautomator2.common.exceptions.StaleElementReferenceException: The element 'By.xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'Message BEFORE edit')]' is not linked to the same object in DOM anymore
    E   	at io.appium.uiautomator2.model.ElementsCache.restore(ElementsCache.java:122)
    E   	at io.appium.uiautomator2.model.ElementsCache.get(ElementsCache.java:153)
    E   	at io.appium.uiautomator2.handler.Location.safeHandle(Location.java:23)
    E   	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)
    E   	at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    E   	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    E   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    E   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    E   	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    E   	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    E   	at java.lang.Thread.run(Thread.java:1012)
    



    Device sessions

    Passed tests (5)

    Click to expand

    Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    @mohsen-ghafouri thanks for the PR. No issues from my side. Please, let us know once wallet connect team approves our new deep link configuration. After that we will re-check this feature using real dapps. Meanwhile I think we can merge this PR.

    @mohsen-ghafouri
    Copy link
    Contributor Author

    Thanks @pavloburykh for you time, i will merge it once test pipeline being fixed.

    @clauxx clauxx merged commit 4a8bb70 into develop Sep 3, 2024
    6 checks passed
    @clauxx clauxx deleted the feat/wc-deeplink branch September 3, 2024 07:52
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Wallet Connect pairing via DeepLinks
    6 participants