-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
I'm having the same issue that has been previously reported but I was unable to fix..
I'm working on an app with chat feature and when the component is mounted, the channel is disconnected and reconnects(aparently).. the same happens with every key stroke while writing a message. On the terminal, everything is working fine, except for the messages informing of the channel being unsubscribed and again subscribed.
The problem is intermitent as sometimes I receive the broadcasted data from the server, and other times nothing comes through.
//request.js
import { ActionCableProvider } from 'react-actioncable-provider';
import ActionCable from 'actioncable';
const cable = ActionCable.createConsumer("ws://localhost:3001/cable");
<ActionCableProvider cable={cable}>
<Chat request_id={this.props.request.id} selected={this.state.selected} sender_id={this.props.user_id} recipient_id={this.props.request.user_id}/>`
</ActionCableProvider>//chat.js
<ActionCableConsumer
channel={{channel: "ConversationsChannel",
conversation: this.state.conversation_id}}
onReceived={this.handleReceived}
onDisconnected={console.log("off")}
onConnected={console.log("on")}
/>full code @this repository
Any help will be extremly appreciated!
Metadata
Metadata
Assignees
Labels
No labels