-
Notifications
You must be signed in to change notification settings - Fork 17
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
add withdraw support and some bugfix for websocket #15
Conversation
authorized := false | ||
for _, req := range requests { | ||
if req.IsPrivateChannel() && !s.authorized { | ||
if req.IsPrivateChannel() && !authorized { | ||
err := s.auth(conn) | ||
if err != nil { | ||
return errors.WithStack(err) | ||
} | ||
s.authorized = true | ||
authorized = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks about right, what error was this encountering before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auth state is not correct after reconnect.
|
||
for { | ||
message := &models.WsResponse{} | ||
err = conn.ReadJSON(&message) | ||
if err != nil { | ||
s.printf("read msg: %v", err) | ||
s.printf("channel %v read msg: %v", ftxChannel, err) | ||
if websocket.IsCloseError(err, websocket.CloseNormalClosure) { | ||
return | ||
} | ||
conn, err = s.reconnect(ctx, requests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an edge case below which panics if reconnect
returns an error, see conn.WriteMessage
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long time since this PR, currently not working on this project, sorry for no time to deal with this.
No description provided.