MetaMask / metamask-sdk

The simplest yet most secure way to connect your blockchain-based applications to millions of MetaMask Wallet users.
https://metamask.io/sdk/
Other
188 stars 115 forks source link

feat: socket reconnection optimization #994

Closed abretonc7s closed 2 months ago

abretonc7s commented 2 months ago

Besides the high level changes described above, this PR also addresses long standing undetected bug when a connection is terminated from mobile, it is not possible to directly reconnect without refreshing the page.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 69.78417% with 84 lines in your changes missing coverage. Please review.

Project coverage is 80.70%. Comparing base (9e9f1ac) to head (61bfe0e). Report is 1 commits behind head on main.

Files Patch % Lines
...kages/sdk/src/provider/initializeMobileProvider.ts 0.00% 21 Missing :warning:
...oteConnection/ConnectionManager/startConnection.ts 69.56% 21 Missing :warning:
...SocketService/ConnectionManager/reconnectSocket.ts 75.60% 10 Missing :warning:
.../RemoteConnection/EventListeners/setupListeners.ts 58.82% 7 Missing :warning:
packages/sdk/src/utils/base64.ts 33.33% 6 Missing :warning:
...rvice/ConnectionManager/handleJoinChannelResult.ts 16.66% 5 Missing :warning:
...oteCommunicationPostMessageStream/extractMethod.ts 66.66% 3 Missing :warning:
...ices/SocketService/ChannelManager/createChannel.ts 85.71% 2 Missing :warning:
...vice/ConnectionManager/setupSocketFocusListener.ts 87.50% 2 Missing :warning:
packages/sdk/src/Platform/MetaMaskInstaller.ts 60.00% 2 Missing :warning:
... and 4 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #994 +/- ## ========================================== + Coverage 80.31% 80.70% +0.39% ========================================== Files 180 177 -3 Lines 4058 3990 -68 Branches 1007 990 -17 ========================================== - Hits 3259 3220 -39 + Misses 799 770 -29 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

socket-security[bot] commented 2 months ago

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

Package New capabilities Transitives Size Publisher
npm/@tanstack/query-core@5.52.2 environment 0 2.02 MB tannerlinsley
npm/@tanstack/react-query@5.52.2 environment 0 1.11 MB tannerlinsley
npm/wagmi@2.12.7 Transitive: environment, eval, filesystem, network, unsafe +37 70.9 MB awkweb

🚮 Removed packages: npm/@metamask/providers@10.2.1)

View full report↗︎

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
10 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud