Skip to content

Commit

Permalink
Fixed impl for explicit authorize on actionAuth msg received
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Sep 2, 2024
1 parent 9bea0c0 commit 947de24
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ably/realtime_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,10 @@ func (c *Connection) eventloop() {
if c.conn != nil {
c.conn.Close()
}
case actionAuth:
// RTN22
c.auth.Authorize(context.Background(), c.auth.params)
case actionAuth: // RTN22
canceledCtx, cancel := context.WithCancel(context.Background())
cancel() // Cancel context to unblock current eventloop to receieve new messages
c.auth.Authorize(canceledCtx, c.auth.params)
default:
c.callbacks.onChannelMsg(msg)
}
Expand Down

0 comments on commit 947de24

Please sign in to comment.