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

add withdraw support and some bugfix for websocket #15

Merged
merged 6 commits into from
Jul 8, 2022

Conversation

mm2175
Copy link
Contributor

@mm2175 mm2175 commented Aug 11, 2021

No description provided.

Comment on lines +256 to +263
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

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?

Copy link
Contributor Author

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)

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.

Copy link
Contributor Author

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.

@grishinsana grishinsana merged commit 2d8a84c into grishinsana:master Jul 8, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants