FIX: no event when threading is disabled (#21439)

Every replies creates a thread, even when threading is disabled. This is how we ensure we can go back and forth. However, a message bus event should only be published when threading is enabled, otherwise frontend will attempt to display a thread which is not possible when disabled.

This fixes a silent background 404 when doing a reply in a direct message channel or a non threading enabled category channel.
This commit is contained in:
Joffrey JAFFEUX
2023-05-09 10:11:29 +02:00
committed by GitHub
parent bc847e54d4
commit 8f27913ec1
3 changed files with 46 additions and 18 deletions

View File

@ -388,6 +388,7 @@ RSpec.describe Chat::ChatController do
context "when sending a message in a staged thread" do
it "creates the thread and publishes with the staged id" do
sign_in(user)
chat_channel.update!(threading_enabled: true)
messages =
MessageBus.track_publish do