openim-sdk-core icon indicating copy to clipboard operation
openim-sdk-core copied to clipboard

Bug: wasm branch, in internal/interaction/ws_conn.go Reconn function ,if ws connect failed ,httpResp is nil,client can't know token expired or token kicked

Open zhaeng opened this issue 2 years ago • 2 comments

What happened?

wasm branch, in internal/interaction/ws_conn.go Reconn function ,if ws connect failed ,httpResp is nil,client can't know token expired or token kicked

What did you expect to happen?

if ws connect failed ,i hope we can get http status code

How can we reproduce it (as minimally and precisely as possible)?

change ws package ?

Anything else we need to know?

No response

version

httpResp is nil

Cloud provider

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

zhaeng avatar Jul 20 '23 09:07 zhaeng

This is because in the event of a WebSocket connection failure, the WebAssembly (Wasm) module is unable to return the corresponding response, thus making it difficult to determine the specific reason for the connection failure. Special handling is required on the web client side in such cases. For instance, the connection can be assumed successful initially, and then the failure message regarding the token can be transmitted through WebSocket. It may take some time to process.

FGadvancer avatar Aug 04 '23 07:08 FGadvancer

This issue has been fixed by #473 .

FGadvancer avatar Nov 21 '24 12:11 FGadvancer