MetaMask / metamask-android-sdk

MetaMask SDK for Android
Other
41 stars 13 forks source link

[Bug]: sendRequest with no response when Queued job #95

Closed philos3 closed 6 months ago

philos3 commented 6 months ago

Provide environment information

error

MetaMask Android SDK Version

io.metamask.androidsdk:metamask-android-sdk:0.5.0

MetaMask Mobile app Version

no

Android Version

android 13

Describe the Bug

console log: D/MM_ANDROID_SDK( 501): Ethereum:: connecting... D/MM_ANDROID_SDK( 501): SessionManager:: Session duration extended by: 7.0 days D/MM_ANDROID_SDK( 501): Analytics: sdk_connect_request_started D/MM_ANDROID_SDK( 501): Ethereum:: Requesting ethereum accounts D/MM_ANDROID_SDK( 501): Ethereum:: Sending request EthereumRequest(id=1708583997198, method=eth_requestAccounts, params=null) D/MM_ANDROID_SDK( 501): CommunicationClient:: sendRequest - not yet connected to metamask, binding service first D/MM_ANDROID_SDK( 501): CommunicationClient:: Queued job D/MM_ANDROID_SDK( 501): CommunicationClient:: Binding service D/MM_ANDROID_SDK( 501): Ethereum:: Sending request EthereumRequest(id=1708583997224, method=eth_chainId, params=null) D/MM_ANDROID_SDK( 501): CommunicationClient:: sendRequest - not yet connected to metamask, binding service first D/MM_ANDROID_SDK( 501): CommunicationClient:: Queued job D/MM_ANDROID_SDK( 501): CommunicationClient:: Binding service

as the log show: sendRequest - not yet connected to metamask, binding service first. it is ok to binde service,but when the service is connected, we should resumeRequestJobs.

image

Expected Behavior

every sendRequest should be response

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

No response

To Reproduce

If metamask is repeatedly called, there is a probability that the window will not pop up

elefantel commented 6 months ago

Hi @philos3, thanks for the issue. Could you please share reproduction steps, describing what happens, instead of describing the code?

FYI once the service connection is established (or re-established) the queued jobs do resume, but only after a successful key exchange - which is why you see the initiateKeyExchange() function call there.