You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes the program will be exited without reason
the close code is 1005
For the definition of code, refer to the definition document of Web Socket https://www.rfc-editor.org/rfc/rfc6455#section-7.4
(Actually it's always 1005 when the dapp call loginout, the sdk will not notify program,and direct call disconnect then throw a code of 1005,for example, on opensea.io),see the following code.
It is noteworthy that
_ webSocket._ webSocket._ closeCode
_ webSocket._ webSocket._ closeReason
There are values in.But obviously these are internal properties I can't access. In addition, I added the Reason and Close parameters on my own initiative.
So in the onDisconnect event, I can't determine whether it is an unexpected end or the user's active end
(If it is an accidental termination, I can reconnect and continue to communicate with DAPP, but if it is the user's active termination, there is no connection significance.)
The difference between the two is that when DAPP is disconnected, according to the official document of WalletConnect, a SessionUpdate method must be sent.
So I added this onSessionUpdate event and called it so that the program can determine whether to reconnect or disconnect
The text was updated successfully, but these errors were encountered:
mmMrz
changed the title
Questions about the disconnect without reason
Issue about the disconnect without reason
Feb 27, 2023
Sometimes the program will be exited without reason
the close code is 1005
For the definition of code, refer to the definition document of Web Socket
https://www.rfc-editor.org/rfc/rfc6455#section-7.4
(Actually it's always 1005 when the dapp call loginout, the sdk will not notify program,and direct call disconnect then throw a code of 1005,for example, on opensea.io),see the following code.
It is noteworthy that
_ webSocket._ webSocket._ closeCode
_ webSocket._ webSocket._ closeReason
There are values in.But obviously these are internal properties I can't access. In addition, I added the Reason and Close parameters on my own initiative.
So in the onDisconnect event, I can't determine whether it is an unexpected end or the user's active end
(If it is an accidental termination, I can reconnect and continue to communicate with DAPP, but if it is the user's active termination, there is no connection significance.)
The difference between the two is that when DAPP is disconnected, according to the official document of WalletConnect, a SessionUpdate method must be sent.
So I added this onSessionUpdate event and called it so that the program can determine whether to reconnect or disconnect
The text was updated successfully, but these errors were encountered: