Resenha - Add Discord-style Video and Voice Rooms to Your Community 🎙

It seems that on the mobile app, you can only create rooms but cannot directly enter already created rooms by clicking on them. However, if you directly access /resenha/r/topic, it works. Is this a bug?

Works just fine for me on my phone, have you updated your Discourse instance this week?

Experimental plugins require frequent updates

5 likes

Lots of updates this month, but the main one is optional and per-room support for SFU via LiveKit.

Full P2P WebRTC is still the main and default supported transport, but SFU is now also supported for people who need to support hundreds of participants in a single room.

We’ve also made lots of improvements, like Audio and Video device pickers on room and widget controls, made Resenha rooms mentionable via # auto complete on chat and posts, room layout options, and more.

15 likes

Thanks for this, the SFU was the real missing piece. It’s what originally pushed me into maintaining a separate fork; with it supported upstream I can retire the fork and track resenha directly.

I’d held off asking about LiveKit because I didn’t know if you wanted to go that direction. Now that you have: are you open to PRs for features and small improvements?

4 likes

@Falco Hey I’ve hit a few reproducible issues while testing the updated resenha. Sharing findings + the patches I’m running locally, in case they’re useful upstream.

1. Admin UI silently discards room_type stage rooms can never stick
app/controllers/resenha/admin_rooms_controller.rb:65 (room_params) omits :room_type from the permit list, and admin_room_serializer.rb never serializes it.

Every stage assignment made through the admin UI is dropped, rooms create as open and “revert” to open on any later admin edit. Confirmed via production logs; the user-facing controller permits it, only the admin path lost it.

# admin_rooms_controller.rb — add :room_type to the permit list, then:
if permitted.key?(:room_type)
  value = Resenha::Room::ROOM_TYPES[permitted[:room_type].to_s]
  raise Discourse::InvalidParameters.new(:room_type) if value.nil?
  permitted[:room_type] = value
end
# admin_room_serializer.rb — serialize room_type so the form initializes correctly

2. Invalid room_type silently falls back to open
app/controllers/resenha/rooms_controller.rb:575ROOM_TYPES[...] || ROOM_TYPE_OPEN.

Any malformed/stale room_type in an otherwise-valid room edit quietly flips a stage room to open. A 400 makes the misbehaving caller visible instead of corrupting the room.

value = Resenha::Room::ROOM_TYPES[permitted[:room_type].to_s]
raise Discourse::InvalidParameters.new(:room_type) if value.nil?
permitted[:room_type] = value

3. Heartbeat resurrects a user who just left (ghost presence)
rooms_controller.rb:234 (heartbeat) unconditionally re-adds presence, so a heartbeat in flight when leave (:220) processes lands second and re-creates the departed user.
The ghost persists until the TTL reap, which doesn’t broadcast — clients show them “in the room” for up to a minute.

Reproduced on device; kick has the identical exposure.

# ParticipantTracker: 15s tombstone
def mark_left(room_id, user_id)  = redis.setex(left_key(room_id, user_id), 15, "1")
def recently_left?(room_id, user_id) = redis.exists?(left_key(room_id, user_id))
# leave/kick → mark_left; join/livekit_token → clear_left; heartbeat:
return head :no_content if Resenha::ParticipantTracker.recently_left?(@room.id, current_user.id)

4. Stale participant_left webhook phantom-kicks a fresh session
livekit_webhooks_controller.rb:37/57 — departures are matched by user identity alone.
On a quick disconnect/rejoin, the superseded session’s participant_left arrives late and expires the new session’s presence (user “kicked” ~3s after rejoining, back ~15s later).
Reproduced on device; the gone_at heuristic can’t distinguish the sessions when the rejoin predates the old session’s disconnect.

# participant_joined → record the live SID
Resenha::ParticipantTracker.set_livekit_sid(room.id, user_id, event.dig("participant", "sid"))
# expire_participant → skip a superseded session's departure
known = Resenha::ParticipantTracker.livekit_sid(room.id, user_id)
return if sid.present? && known.present? && sid != known

5. DeleteRoom 404 after the last leave floods the logs
lib/resenha/livekit/room_service_client.rb:84 warns on any non-200.
The SFU auto-closes a room the moment it empties, so the last leave’s DeleteRoom routinely races it — “requested room does not exist” is the desired end state, not a fault.
It lands in Logster on every last-leave.

elsif method == "DeleteRoom" && response.status == 404
  Rails.logger.debug("[resenha-livekit] DeleteRoom no-op for room #{room.id}: already gone")
  true

I can send a pull request if you wish.

As I said in previous I don’t know your direction in full, but you can have a look at mines as I’ve made a post here → Discourse Desktop Mac App - #10 by nicolsdennis

2 likes

This would be absolutely brilliant - it would make sense to make it hook into the Livestream mechanism, which would provide the associated chat channel as part of a beautiful integrated experience

4 likes

Hi, when changing the name of the room, it doesn’t update the slug. Also, it doesn’t let me delete rooms – I get server error.

It would also be nice to be able to visually change the order of the rooms and how they appear.

Thanks for the detailed report, just a merged a PR for those:

6 likes

I’ve got a couple of minor UI/UX things related to private voice rooms:

1. The private / lock micro-icon is too small.

Great that we have an icon indicating the privacy status of a room; unfortunately it
is too small, and overlaps the icon a lot. And is inconsitent with the rest of the sidebar:

image   image

2. The participant list is hard to find

You can only get to the participant list in a private voiceroom from within the call itself.

This isn’t super-intuitive. I expect to be able to modify the participants / invitees from the settings available when the voiceroom is inactive as well. There are plently of settings available when it is inactive (including public vs private, max participants, etc), just not the actual participant list.

3 likes

I have made fixes for both of those, thanks for the report @nathank!

2 likes

I wonder if it is possible to link a specific room from href links? Want to add a shortcut to a single test room to simplify our UX.

Yeah, it is now possible in this format

https://discourse-on-a-pi5.falco.dev/resenha/r/watercooler

4 likes

Also worth highlighting recent improvements:

Support for private STUN/TURN via coturn auth

This allows you to keep your coturn instance restricted to you, and it’s very easy to configure with a shared secret between Discourse and Coturn.

Support for session recording when using LiveKit

All via the call UI, single click to start recording, single click to stop.

Flag support for call participants

While the flag will lack context, users can provide it via the text area

Right click menu on the video tiles

Easy to adjust volume of a peer, or kick, etc.

Opt-in higher quality for voice, video and screen sharing

My favorite feature of the week, this allows users to opt into much higher bitrate limits, and get much better audio / video.

6 likes

Much better!!! Thank you for listening (and acting)!!

image

2 likes

Is it my instance or probably something to look into? I’m recieving error 500 when trying to remove voice rooms from admin panel:

ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR:  update or delete on table "resenha_rooms" violates foreign key constraint "fk_rails_ID" on table "resenha_sessions" DETAIL:  Key (id)=(1) is still referenced from table "resenha_sessions".
1 like

Thanks for the report, fix is merged

2 likes

Thanks for this ultra-fast fix; it worked as expected.

Just a little note, following up: changing the default room name did not update the path /resenha/r/watercooler, but I was now able to remove the previous default room and add a fresh one.

1 like

I have made the slug explicitly editable now, so it works like categories

6 likes

You can also add some URL params to open in a specific way:

https://discourse-on-a-pi5.falco.dev/resenha/r/watercooler?join, just enters the room, no click to join button

https://discourse-on-a-pi5.falco.dev/resenha/r/watercooler?join&widget (added earlier this week), opens and turns into widget mode

https://discourse-on-a-pi5.falco.dev/resenha/r/watercooler?join&chat opens in chat mode

3 likes

We have been using this plugin internally for meetings, which has been great for gathering feedback and evolving it based on real use cases. In the last two weeks, the highlights are:

AI Noise Suppression

Noise suppression was completely re-done, with several changes. We now offer controls to handle the standard WebRTC features:

  • Noise Suppression
  • Auto Gain Control
  • Echo Cancellation

Furthermore, the plugin now ships three different AI models for those who need better noise suppression, from low to high respectively:

  • RNNoise
  • DTLN
  • DeepFilter3

Direct calls

Users can now initiate 1-to-1 or 1-to-many direct calls via a button on the user card. This uses ephemeral rooms infrastructure we built, which will also be used to handle integrations in the future, like with the events plugin.

Invites

Right-clicking a room allows you to generate invites, and it uses your conversation history in that room to suggest users.

Sound packs

Resenha sounds now follow your preferred sound pack from New chat notification sound packs.

Room UX

Right-click to copy link to room, widget tiles auto-sizing and collapse, widget positioning above the site header, shift+click room support, accuracy and better performance on the voice activity indicator.

Android Camera Switching

You can now switch between your Android phone front and back cameras seamlessly mid-call.

Mesh connectivity warning

The first time a user tries to connect to a room that uses WebRTC mesh, we present a warning that explains potential IP exposure.

And last but not least, two experimental features :scientist:

Live Subtitles

We added opt-in live subtitles, powered by state-of-the-art AI models running on device.

When enabled, we download a 2.5GB AI model that is run using WebGPU, so compatibility is restricted to fast and modern devices.

There is a lot to polish and fine-tune on this feature, so let me know how it goes.

Transcription

Users with live subtitles enabled can now start transcriptions from those, which are backed to a new topic draft. After finishing the recording, you get a composer with all the saved transcriptions using the same format chat quotes use.

8 likes