Skip to content

Web-socket unsubscribes and doesn't reconnect #21

@samuelsalter

Description

@samuelsalter

I've suffered from an issue that once a message is received and the state changes, triggering a render, it sends an unsubscribe command, followed by a subscribe command. 95% of the time it doesn't reconnect, I'm unsure if this is an asynchronous issue or intended behaviour.

To get around this, I've had to render the ActionCableConsumer just once:

    this.acc || (this.acc = <ActionCableConsumer
             channel='NotificationsChannel'
             onReceived={this.handleReceived}
           />);

Is there a better way of doing this? Or am I missing something?

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