Skip to content

state.attempts is never reset #33

@meyercm

Description

@meyercm

In the situation where periodic disconnections are expected, the component will eventually always use the max retry backoff, because a successful reconnection never resets state.attempts.

I'll happily put together a pull request if you'd like, or just add this snippet

websocket.onopen = () => {
      this.logging('Websocket connected')
      this.setState({ attempts: 1 }) // Add this line so that reconnecting resets the retry cooloff.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions