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

feat: sdk deeplinking protocol #9114

Merged
merged 44 commits into from
Apr 11, 2024
Merged

Conversation

abretonc7s
Copy link
Contributor

@abretonc7s abretonc7s commented Apr 2, 2024

Description

Deep Linking Based Communication Layer for MetaMask iOS SDK

The objective is to introduce a MetaMask SDK communication layer for iOS that enables direct interaction between a mobile iOS DApp and the MetaMask Mobile app, bypassing the Socket.io server. This direct communication approach aims to enhance speed and reliability. Initially, this will be an optional feature, not the default setting, as it necessitates specific app customizations outlined in the document below.

Document that explain in detail the feature:
https://docs.google.com/document/d/1211R1kIQmhuUSox-nBXh1k1Dq64TrELNAR31QdSHJns/edit?usp=sharing

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Here there are all the flows:

  • Connect with Request
  • Connect and Sign
  • Normal Connection and then Sign
Screen.Recording.2024-04-10.at.17.35.57.mov

Here there is a Connection and then batch RPC requests:

Screen.Recording.2024-04-10.at.17.34.32.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

github-actions bot commented Apr 2, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 45.29%. Comparing base (35915bb) to head (7081398).

Files Patch % Lines
...linkManager/ParseManager/handleMetaMaskDeeplink.ts 10.00% 7 Missing and 2 partials ⚠️
...ect/SDKDeeplinkProtocol/DeeplinkProtocolService.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           feat/sdk_conn    #9114      +/-   ##
=================================================
- Coverage          45.30%   45.29%   -0.02%     
=================================================
  Files               1272     1273       +1     
  Lines              31285    31296      +11     
  Branches            3198     3202       +4     
=================================================
+ Hits               14174    14175       +1     
- Misses             16263    16271       +8     
- Partials             848      850       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from feat/sdk_conn to main April 4, 2024 10:16
@elefantel elefantel force-pushed the feat/deeplinkcommunication branch from cae4d89 to 350a125 Compare April 10, 2024 08:30
Copy link

socket-security bot commented Apr 10, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@walletconnect/encoding@1.0.2 None 0 294 kB bkrem

View full report↗︎

@christopherferreira9 christopherferreira9 added Run Smoke E2E Triggers smoke e2e on Bitrise QA in Progress QA has started on the feature. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Apr 10, 2024
Copy link
Contributor

github-actions bot commented Apr 10, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 56c200d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d470e35f-fbfd-44a1-a204-2d437fef9955

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@omridan159 omridan159 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 11, 2024
Copy link
Contributor

github-actions bot commented Apr 11, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 198815b
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/113d3850-63e9-4cde-b1af-5592bb46784d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link
Contributor

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

@christopherferreira9
Copy link
Contributor

Tests performed:

  • regression test on iOS Deeplink communication with iOS Dapp
  • regression test Socket.io communication with iOS Dapp
  • regression test on Android SDK
  • regression test WalletConnect
  • regression test on JS SDK
  • regression tests on the overall deeplink behaviours

Compatibility with both communication formats was ensured.

Observations:
The Connection prompt is sometimes showing before unlocking the device when face ID is enabled and Deeplink communication is used. This causes the wallet to return “server” error sometimes. Could be a race condition. Given that this is not consistent and it doesn't block the overall behaviour of the SDK we're safe to move forward.
Steps: Lock MM -> Go to dapp -> Connect (and cover faceid) -> See the connection appear.

ChainId and selectedAddress are not currently being synced when using the deeplink communication since we haven't decided on what the behaviour should be when it comes to this flow as we don't want to deeplink to all available deeplink connection to let the Dapps know the selectedAddress or chainId was changed.
This same applies for the terminating of sessions from both Dapp -> MetaMask and MetaMask -> Dapp

@christopherferreira9 christopherferreira9 added Run Smoke E2E Triggers smoke e2e on Bitrise QA Passed A successful QA run through has been done and removed Run Smoke E2E Triggers smoke e2e on Bitrise needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) QA in Progress QA has started on the feature. labels Apr 11, 2024
Copy link
Contributor

github-actions bot commented Apr 11, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 35c6938
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fb7358a4-ac8b-4dc3-b86d-36e9d5420592

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

@christopherferreira9 christopherferreira9 merged commit 1f807e5 into main Apr 11, 2024
38 of 41 checks passed
@christopherferreira9 christopherferreira9 deleted the feat/deeplinkcommunication branch April 11, 2024 15:55
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2024
@metamaskbot metamaskbot added the release-7.21.0 Issue or pull request that will be included in release 7.21.0 label Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.21.0 Issue or pull request that will be included in release 7.21.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-sdk SDK team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants