Skip to content

Pusher Error codes are not handled #40

Description

@tacticiankerala

I found the following in the pusher documentation and also found that the library is not handling the same.

Connection closure

Clients may close the WebSocket connection at any time.

The Pusher server may choose to close the WebSocket connection, in which case a close code and reason will be sent.

Clients SHOULD support the following 3 ranges

  • 4000-4099: The connection SHOULD NOT be re-established unchanged.
  • 4100-4199: The connection SHOULD be re-established after backing off. The back-off time SHOULD be at least 1 second in duration and MAY be exponential in nature on consecutive failures.
  • 4200-4299: The connection SHOULD be re-established immediately.

The following is how it is handled in the library:

bind('pusher:error') do |data|
        PusherClient.logger.fatal("Pusher : error : #{data.inspect}")
 end

This is resulting in infinite loop that logs "end of file reached", when pusher closes the connection with the error code 4200.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions