Skip to content

Add awareness channel

Hannes Moser requested to merge awareness-channel into master

What does this MR do and why?

The awareness channel allows clients to subscribe to changes in an Awareness session via a Websocket (ActionCable) connection. It also enables clients to report back any activity (touch) from their side, and request updates to the current state of the awareness session.

This is in addition to the preliminary work done in !90914 (merged).

This MR adds two utility methods to AwarenessSession. They allow us to use any instance of AwarenessSession the same way as any other Model. In other words, it makes the following work:

class AwarenessChannel
  def subscribed
    stream_for session
  end
end

Otherwise, we'd need to craft the broadcasting value ourselves.

class AwarenessChannel
  def subscribed
    stream_from "awareness:#{session.id}"
  end
end

Screenshots or screen recordings

This MR does not include the implementation for the user interface, but the following screenshot demos the intended usage pattern.

Screen_Shot_2022-07-08_at_11.57.39

A video with lots of details about the Awareness UX.

https://www.youtube.com/watch?v=B094U_DvL-s

How to set up and validate locally

  1. Run specs

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hannes Moser

Merge request reports