Websockets (Beta)
Websockets are a crucial part of any real-time feature. On our case, we're talking about Chat and Notifications.
Notifications
Name: *NotificationChannel*
Pubsub queue: "notification-channel-#{community_member_id}"
This channel is used for communication of all real time notifications for a community member. This channel receives following events:
newNotification
This event is received whenever community member receives a new in-app notification
updateNewNotificationCount
This event is received whenever there is change in community member’s in-app notification count
Additional information received with the event:
resetNewNotificationCount
This event is received to mark all notifications as read.
Additional information received with the event:
Chat
We have 3 channels to manage websocket communications for messaging.
👉 chat-room-channel-#{community_member.id}
👉 chat-room-#{chat_room.id}-channel
👉 chat-community-member-#{community_member_id}-threads-channel
chat-room-channel-#{community_member.id}
This channel receives all updates regarding messaging which are specific to a member, all other events from a room which are common for all members are communicated on chat room channel.
Channel details:
Name: *ChatRoomChannel*
Pubsub queue: chat-room-channel-#{community_member.id}
Events:
Chat Room events:
chatRoomCreated
This event is broadcasted on a non embedded chat room creation.
Additional information received with the event
chatRoomUpdated
This event gets broadcasted in following cases:
when non embedded chat room name is changed.
when non embedded chat room gets pinned.
Please note that same event is broadcasted on
chat-room-#{chat_room.id}-channel
channel on updating room specific attributes like:pinned_message_id, :show_history, :description, :name
attributes.Additional information received with the event:
chatRoomDeleted
This event gets broadcasted on chat room deletion.
Additional information received with the event:
chatRoomRead
This event gets broadcasted when chatroom gets marked as read by a participant.
Additional information received with the event:
chatRoomPinned
This event gets broadcasted when a non embedded chat room is pinned by a community member.
Additional information received with the event:
chatRoomUnPinned
This event gets broadcasted when a non embedded chat room is un-pinned by a community member.
Additional information received with the event:
ChatRoomMessage events:
newMessage
This event gets broadcasted for each new non reply message in a non embedded chat room.
Additional information received with the event:
Note: We are broadcasting exact same event on chat-room-#{chat_room.id}-channel currently for all new messages including replies. This is sent for all embedded and non embedded rooms.
chat-room-#{chat_room.id}-channel
We are using this channel to post chat room events which are not intended for a specific community member.
Channel details:
Name: *Chats*::*RoomChannel*
Pubsub queue: chat-room-#{*chat_room*.id}-channel
Events:
ChatRoomMessage events:
newMessage
This event gets broadcasted for each new message in the chat room
Additional information received with the event:
deletedMessage
This event gets broadcasted when a message gets deleted from the chat room
Additional information received with the event:
updatedMessage
This event gets broadcasted when a message is updated
Additional information received with the event:
chat-community-member-#{community_member_id}-threads-channel
We are using this channel to communicate events for the threads that a community is part of
Channel details:
Name: *Chats*::*CommunityMemberThreadsChannel*
Pubsub queue: chat-community-member-#{community_member_id}-threads-channel
newMessage
This event gets broadcasted for each new message in the chat thread.
Additional information received with the event:
updatedMessage
This event gets broadcasted when a message is updated in chat thread
Additional information received with the event:
deletedMessage
This event gets broadcasted when a message gets deleted from the chat thread
Additional information received with the event:
chatThreadRead
This event gets broadcasted when chatroom gets marked as read by a participant.
Additional information received with the event:
Last updated