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

Issue about the disconnect without reason #53

Open
mmMrz opened this issue Feb 27, 2023 · 0 comments
Open

Issue about the disconnect without reason #53

mmMrz opened this issue Feb 27, 2023 · 0 comments

Comments

@mmMrz
Copy link

mmMrz commented 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.
close
listen
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
add function call
add function

@mmMrz mmMrz changed the title Questions about the disconnect without reason Issue about the disconnect without reason Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant