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

fix: ws conn token error unprocessed #163

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion internal/interaction/long_conn_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,20 @@ func (c *LongConnMgr) reConn(ctx context.Context, num *int) error {
if err := json.Unmarshal(body, &apiResp); err != nil {
return err
}
c.listener.OnConnectFailed(int32(apiResp.ErrCode), apiResp.ErrMsg)
switch apiResp.ErrCode {
case
errs.TokenExpiredError,
errs.TokenInvalidError,
errs.TokenMalformedError,
errs.TokenNotValidYetError,
errs.TokenUnknownError,
errs.TokenKickedError,
errs.TokenNotExistError:
c.listener.OnUserTokenExpired()
_ = common.TriggerCmdLogOut(ctx, c.loginMgrCh)
default:
c.listener.OnConnectFailed(int32(apiResp.ErrCode), apiResp.ErrMsg)
}
log.ZWarn(ctx, "long conn establish failed", sdkerrs.New(apiResp.ErrCode, apiResp.ErrMsg, apiResp.ErrDlt))
return errs.NewCodeError(apiResp.ErrCode, apiResp.ErrMsg).WithDetail(apiResp.ErrDlt).Wrap()
}
Expand Down
Loading