A platform for community discussion. Free, open, simple.
DEV: Remove experimental site setting for chat threads (#22720)
Jan Cernika2eb2b0490cb
diff --git a/plugins/chat/app/jobs/regular/chat/mark_all_channel_threads_read.rb b/plugins/chat/app/jobs/regular/chat/mark_all_channel_threads_read.rbindex a257e865b02..bc190b25c89 100644--- a/plugins/chat/app/jobs/regular/chat/mark_all_channel_threads_read.rb+++ b/plugins/chat/app/jobs/regular/chat/mark_all_channel_threads_read.rb@@ -6,7 +6,6 @@ module Jobssidekiq_options queue: "critical"def execute(args = {})- return if !SiteSetting.enable_experimental_chat_threaded_discussionschannel = ::Chat::Channel.find_by(id: args[:channel_id])return if channel.blank?channel.mark_all_threads_as_readdiff --git a/plugins/chat/app/jobs/regular/chat/update_thread_reply_count.rb b/plugins/chat/app/jobs/regular/chat/update_thread_reply_count.rbindex 4173c6ecc10..5e15cb35808 100644--- a/plugins/chat/app/jobs/regular/chat/update_thread_reply_count.rb+++ b/plugins/chat/app/jobs/regular/chat/update_thread_reply_count.rb@@ -4,8 +4,6 @@ module Jobsmodule Chatclass UpdateThreadReplyCount < Jobs::Basedef execute(args = {})- return if !SiteSetting.enable_experimental_chat_threaded_discussions-thread = ::Chat::Thread.find_by(id: args[:thread_id])return if thread.blank?return if thread.replies_count_cache_recently_updated?diff --git a/plugins/chat/app/models/chat/channel.rb b/plugins/chat/app/models/chat/channel.rbindex 977e82bd6c4..8c108a05534 100644--- a/plugins/chat/app/models/chat/channel.rb+++ b/plugins/chat/app/models/chat/channel.rb@@ -188,9 +188,7 @@ module Chatenddef mark_all_threads_as_read(user: nil)- if !(self.threading_enabled || SiteSetting.enable_experimental_chat_threaded_discussions)- return- end+ return if !self.threading_enabledDB.exec(<<~SQL, channel_id: self.id)UPDATE user_chat_thread_membershipsdiff --git a/plugins/chat/app/models/chat/thread.rb b/plugins/chat/app/models/chat/thread.rbindex 236bc72dba4..c1a7c8bc2c6 100644--- a/plugins/chat/app/models/chat/thread.rb+++ b/plugins/chat/app/models/chat/thread.rb@@ -108,7 +108,6 @@ module Chatenddef self.ensure_consistency!- return if !SiteSetting.enable_experimental_chat_threaded_discussionsupdate_countsenddiff --git a/plugins/chat/app/serializers/chat/channel_serializer.rb b/plugins/chat/app/serializers/chat/channel_serializer.rbindex 6664410ec85..fe154125dff 100644--- a/plugins/chat/app/serializers/chat/channel_serializer.rb+++ b/plugins/chat/app/serializers/chat/channel_serializer.rb@@ -25,10 +25,6 @@ module Chathas_one :last_message, serializer: Chat::LastMessageSerializer, embed: :objects- def threading_enabled- SiteSetting.enable_experimental_chat_threaded_discussions && object.threading_enabled- end-def initialize(object, opts)super(object, opts)diff --git a/plugins/chat/app/serializers/chat/message_serializer.rb b/plugins/chat/app/serializers/chat/message_serializer.rbindex 05df1d5baa3..ffe59d2a467 100644--- a/plugins/chat/app/serializers/chat/message_serializer.rb+++ b/plugins/chat/app/serializers/chat/message_serializer.rb@@ -177,7 +177,7 @@ module Chatenddef include_threading_data?- SiteSetting.enable_experimental_chat_threaded_discussions && channel.threading_enabled+ channel.threading_enabledenddef include_thread_id?diff --git a/plugins/chat/app/serializers/chat/structured_channel_serializer.rb b/plugins/chat/app/serializers/chat/structured_channel_serializer.rbindex 10b31b4a0e9..5911191230c 100644--- a/plugins/chat/app/serializers/chat/structured_channel_serializer.rb+++ b/plugins/chat/app/serializers/chat/structured_channel_serializer.rb@@ -8,10 +8,6 @@ module Chatobject[:tracking]end- def include_unread_thread_overview?- SiteSetting.enable_experimental_chat_threaded_discussions- end-def unread_thread_overviewobject[:unread_thread_overview]enddiff --git a/plugins/chat/app/serializers/chat/view_serializer.rb b/plugins/chat/app/serializers/chat/view_serializer.rbindex f1399bf522a..027387b3962 100644--- a/plugins/chat/app/serializers/chat/view_serializer.rb+++ b/plugins/chat/app/serializers/chat/view_serializer.rb@@ -36,7 +36,7 @@ module Chatenddef include_thread_data?- channel.threading_enabled && SiteSetting.enable_experimental_chat_threaded_discussions+ channel.threading_enabledenddef channeldiff --git a/plugins/chat/app/services/chat/channel_view_builder.rb b/plugins/chat/app/services/chat/channel_view_builder.rbindex 4cc54252cfb..aa3c104524a 100644--- a/plugins/chat/app/services/chat/channel_view_builder.rb+++ b/plugins/chat/app/services/chat/channel_view_builder.rb@@ -112,8 +112,7 @@ module Chatenddef determine_threads_enabled(channel:, **)- context.threads_enabled =- SiteSetting.enable_experimental_chat_threaded_discussions && channel.threading_enabled+ context.threads_enabled = channel.threading_enabledenddef determine_include_thread_messages(contract:, threads_enabled:, **)diff --git a/plugins/chat/app/services/chat/lookup_channel_threads.rb b/plugins/chat/app/services/chat/lookup_channel_threads.rbindex 307df0cec5d..60255561906 100644--- a/plugins/chat/app/services/chat/lookup_channel_threads.rb+++ b/plugins/chat/app/services/chat/lookup_channel_threads.rb@@ -24,7 +24,6 @@ module Chat# @param [Integer] offset# @return [Service::Base::Context]- policy :threaded_discussions_enabledcontractstep :set_limitstep :set_offset@@ -55,10 +54,6 @@ module Chatcontext.offset = [contract.offset || 0, 0].maxend- def threaded_discussions_enabled- ::SiteSetting.enable_experimental_chat_threaded_discussions- end-def fetch_channel(contract:, **)::Chat::Channel.strict_loading.includes(:chatable).find_by(id: contract.channel_id)enddiff --git a/plugins/chat/app/services/chat/lookup_thread.rb b/plugins/chat/app/services/chat/lookup_thread.rbindex ba6c3f66471..789665ae588 100644--- a/plugins/chat/app/services/chat/lookup_thread.rb+++ b/plugins/chat/app/services/chat/lookup_thread.rb@@ -2,10 +2,7 @@module Chat# Finds a thread within a channel. The thread_id and channel_id must- # match. For now we do not want to allow fetching threads if the- # enable_experimental_chat_threaded_discussions hidden site setting- # is not turned on, and the channel must specifically have threading- # enabled.+ # match, and the channel must specifically have threading enabled.## @example# Chat::LookupThread.call(thread_id: 88, channel_id: 2, guardian: guardian)@@ -19,7 +16,6 @@ module Chat# @param [Guardian] guardian# @return [Service::Base::Context]- policy :threaded_discussions_enabledcontractmodel :thread, :fetch_threadpolicy :invalid_access@@ -37,10 +33,6 @@ module Chatprivate- def threaded_discussions_enabled- SiteSetting.enable_experimental_chat_threaded_discussions- end-def fetch_thread(contract:, **)Chat::Thread.includes(:channel,diff --git a/plugins/chat/app/services/chat/publisher.rb b/plugins/chat/app/services/chat/publisher.rbindex 1f9e22502c4..5d5a39bdadd 100644--- a/plugins/chat/app/services/chat/publisher.rb+++ b/plugins/chat/app/services/chat/publisher.rb@@ -32,7 +32,7 @@ module Chatenddef self.allow_publish_to_thread?(channel)- SiteSetting.enable_experimental_chat_threaded_discussions && channel.threading_enabled+ channel.threading_enabledenddef self.publish_new!(chat_channel, chat_message, staged_id, staged_thread_id: nil)@@ -161,8 +161,7 @@ module Chatdef self.publish_delete!(chat_channel, chat_message)message_bus_targets = calculate_publish_targets(chat_channel, chat_message)latest_not_deleted_message_id =- if chat_message.thread_reply? && chat_channel.threading_enabled &&- SiteSetting.enable_experimental_chat_threaded_discussions+ if chat_message.thread_reply? && chat_channel.threading_enabledchat_message.thread.latest_not_deleted_message_id(anchor_message_id: chat_message.id)elsechat_channel.latest_not_deleted_message_id(anchor_message_id: chat_message.id)diff --git a/plugins/chat/app/services/chat/tracking_state.rb b/plugins/chat/app/services/chat/tracking_state.rbindex 74c6b08d5d5..17cec53be51 100644--- a/plugins/chat/app/services/chat/tracking_state.rb+++ b/plugins/chat/app/services/chat/tracking_state.rb@@ -34,7 +34,6 @@ module Chat# @return [Service::Base::Context]contract- policy :threaded_discussions_settings_okstep :cast_thread_and_channel_ids_to_integermodel :report@@ -49,11 +48,6 @@ module Chatprivate- def threaded_discussions_settings_ok(contract:, **)- return true if !contract.include_threads- SiteSetting.enable_experimental_chat_threaded_discussions- end-def cast_thread_and_channel_ids_to_integer(contract:, **)contract.thread_ids = contract.thread_ids.map(&:to_i)contract.channel_ids = contract.channel_ids.map(&:to_i)diff --git a/plugins/chat/app/services/chat/update_thread.rb b/plugins/chat/app/services/chat/update_thread.rbindex 4b7e7327a66..b4ccad8673e 100644--- a/plugins/chat/app/services/chat/update_thread.rb+++ b/plugins/chat/app/services/chat/update_thread.rb@@ -2,10 +2,7 @@module Chat# Updates a thread. The thread_id and channel_id must- # match. For now we do not want to allow updating threads if the- # enable_experimental_chat_threaded_discussions hidden site setting- # is not turned on, and the channel must specifically have threading- # enabled.+ # match, and the channel must specifically have threading enabled.## Only the thread title can be updated.#@@ -22,7 +19,6 @@ module Chat# @option params_to_edit [String,nil] title# @return [Service::Base::Context]- policy :threaded_discussions_enabledcontractmodel :thread, :fetch_threadpolicy :can_view_channel@@ -43,10 +39,6 @@ module Chatprivate- def threaded_discussions_enabled- SiteSetting.enable_experimental_chat_threaded_discussions- end-def fetch_thread(contract:, **)Chat::Thread.find_by(id: contract.thread_id, channel_id: contract.channel_id)enddiff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.hbsindex 78ca5ba2726..e295144af33 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.hbs+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.hbs@@ -127,31 +127,29 @@</div>{{/if}}- {{#if this.togglingThreadingAvailable}}- <div class="chat-form__section -threading">- <div class="chat-form__field">- <label class="chat-form__label">- <span>{{i18n "chat.settings.channel_threading_label"}}</span>- <span class="channel-settings-view__channel-threading-tooltip">- {{d-icon "info-circle"}}- <DTooltip>- {{i18n "chat.settings.channel_threading_description"}}- </DTooltip>- </span>- <ChatChannelSettingsSavedIndicator- @property={{@channel.threadingEnabled}}- />- </label>- <ComboBox- @content={{this.threadingEnabledOptions}}- @value={{@channel.threadingEnabled}}- @valueProperty="value"- @class="channel-settings-view__selector"- @onChange={{this.onToggleThreadingEnabled}}+ <div class="chat-form__section -threading">+ <div class="chat-form__field">+ <label class="chat-form__label">+ <span>{{i18n "chat.settings.channel_threading_label"}}</span>+ <span class="channel-settings-view__channel-threading-tooltip">+ {{d-icon "info-circle"}}+ <DTooltip>+ {{i18n "chat.settings.channel_threading_description"}}+ </DTooltip>+ </span>+ <ChatChannelSettingsSavedIndicator+ @property={{@channel.threadingEnabled}}/>- </div>+ </label>+ <ComboBox+ @content={{this.threadingEnabledOptions}}+ @value={{@channel.threadingEnabled}}+ @valueProperty="value"+ @class="channel-settings-view__selector"+ @onChange={{this.onToggleThreadingEnabled}}+ /></div>- {{/if}}+ </div>{{/if}}{{#unless @channel.isDirectMessageChannel}}diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.jsindex dc5560886ef..a5c980d5ed1 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-settings-view.js@@ -59,14 +59,6 @@ export default class ChatChannelSettingsView extends Component {return this.args.channel.isCategoryChannel;}- get togglingThreadingAvailable() {- return (- this.siteSettings.enable_experimental_chat_threaded_discussions &&- this.args.channel.isCategoryChannel &&- this.currentUser?.admin- );- }-get autoJoinAvailable() {return (this.siteSettings.max_chat_auto_joined_users > 0 &&diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.hbs b/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.hbsindex 06e8213a245..cd30124048e 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.hbs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.hbs@@ -104,25 +104,23 @@</div>{{/if}}- {{#if this.threadingAvailable}}- <div class="chat-modal-create-channel__control -threading-toggle">- <label class="chat-modal-create-channel__label">- <Input- name="threading_enabled"- @type="checkbox"- @checked={{this.threadingEnabled}}- />- <div class="threading-channel">- <span class="chat-modal-create-channel__label-title">- {{i18n "chat.create_channel.threading.label"}}- </span>- <p class="chat-modal-create-channel__label-description">- {{i18n "chat.settings.channel_threading_description"}}- </p>- </div>- </label>- </div>- {{/if}}+ <div class="chat-modal-create-channel__control -threading-toggle">+ <label class="chat-modal-create-channel__label">+ <Input+ name="threading_enabled"+ @type="checkbox"+ @checked={{this.threadingEnabled}}+ />+ <div class="threading-channel">+ <span class="chat-modal-create-channel__label-title">+ {{i18n "chat.create_channel.threading.label"}}+ </span>+ <p class="chat-modal-create-channel__label-description">+ {{i18n "chat.settings.channel_threading_description"}}+ </p>+ </div>+ </label>+ </div></:body><:footer><buttondiff --git a/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.js b/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.jsindex 7d5a35c0f46..f615a4eb5ba 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.js+++ b/plugins/chat/assets/javascripts/discourse/components/chat/modal/create-channel.js@@ -50,13 +50,6 @@ export default class ChatModalCreateChannel extends Component {return isPresent(this.category);}- get threadingAvailable() {- return (- this.siteSettings.enable_experimental_chat_threaded_discussions &&- this.categorySelected- );- }-get createDisabled() {return !this.categorySelected || isBlank(this.name);}diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-channel-composer.js b/plugins/chat/assets/javascripts/discourse/services/chat-channel-composer.jsindex 1c0a8ff0a8f..b745b153dff 100644--- a/plugins/chat/assets/javascripts/discourse/services/chat-channel-composer.js+++ b/plugins/chat/assets/javascripts/discourse/services/chat-channel-composer.js@@ -7,7 +7,6 @@ export default class ChatChannelComposer extends Service {@service chat;@service currentUser;@service router;- @service siteSettings;@service("chat-thread-composer") threadComposer;@tracked message;@@ -53,10 +52,7 @@ export default class ChatChannelComposer extends Service {async replyTo(message) {this.chat.activeMessage = null;- if (- this.siteSettings.enable_experimental_chat_threaded_discussions &&- message.channel.threadingEnabled- ) {+ if (message.channel.threadingEnabled) {if (!message.thread?.id) {message.thread = message.channel.createStagedThread(message);}diff --git a/plugins/chat/config/locales/server.de.yml b/plugins/chat/config/locales/server.de.ymlindex 2aa923d6413..1346446c69e 100644--- a/plugins/chat/config/locales/server.de.yml+++ b/plugins/chat/config/locales/server.de.yml@@ -27,7 +27,6 @@ de:max_mentions_per_chat_message: "Maximale Anzahl von @name-Benachrichtigungen, die ein Benutzer in einer Chat-Nachricht verwenden kann."chat_max_direct_message_users: "Benutzer können nicht mehr als diese Anzahl anderer Benutzer hinzufügen, wenn sie eine neue Direktnachricht erstellen. Auf 0 setzen, um nur Nachrichten an sich selbst zuzulassen. Teammitglieder sind von dieser Einstellung ausgenommen."chat_allow_archiving_channels: "Dem Team erlauben, Nachrichten zu einem Thema zu archivieren, wenn sie einen Kanal schließen."- enable_experimental_chat_threaded_discussions: "EXPERIMENTELL: Team-Mitgliedern erlauben, Threading in Chat-Kanälen zu aktivieren, damit parallele Diskussionen in einem Kanal stattfinden können, wenn Benutzer einander antworten."errors:chat_default_channel: "Der Standard-Chat-Kanal muss ein öffentlicher Kanal sein."direct_message_enabled_groups_invalid: "Du musst mindestens eine Gruppe für diese Einstellung angeben. Wenn du nicht möchtest, dass andere Personen als Teammitglieder Direktnachrichten senden, wähle die Gruppe für Teammitglieder aus."diff --git a/plugins/chat/config/locales/server.en.yml b/plugins/chat/config/locales/server.en.ymlindex afc1fcc06b4..5b31f3e539c 100644--- a/plugins/chat/config/locales/server.en.yml+++ b/plugins/chat/config/locales/server.en.yml@@ -21,7 +21,6 @@ en:max_mentions_per_chat_message: "Maximum number of @name notifications a user can use in a chat message."chat_max_direct_message_users: "Users cannot add more than this number of other users when creating a new direct message. Set to 0 to only allow messages to oneself. Staff are exempt from this setting."chat_allow_archiving_channels: "Allow staff to archive messages to a topic when closing a channel."- enable_experimental_chat_threaded_discussions: "EXPERIMENTAL: Allow staff to enable threading on chat channels, which allows for parallel discussions to occur in a channel when users reply to one another."errors:chat_default_channel: "The default chat channel must be a public channel."direct_message_enabled_groups_invalid: "You must specify at least one group for this setting. If you do not want anyone except staff to send direct messages, choose the staff group."diff --git a/plugins/chat/config/locales/server.he.yml b/plugins/chat/config/locales/server.he.ymlindex b140546b5fa..a2372479c4b 100644--- a/plugins/chat/config/locales/server.he.yml+++ b/plugins/chat/config/locales/server.he.yml@@ -27,7 +27,6 @@ he:max_mentions_per_chat_message: "מספר התראות מרבי של @שם בהן יכול להשתמש משתמש בהודעת צ׳אט."chat_max_direct_message_users: "משתמשים לא יכולים להוסיף יותר מכמות זו של משתמשים אחרים בעת יצירת הודעה ישירה חדשה. יש להגדיר ל־0 כדי לאפשר הודעות עצמיות. הסגל מוחרג מההגדרה הזאת."chat_allow_archiving_channels: "לאפשר לסגל להעביר הודעות לארכיון בנושא בעת סגירת ערוץ."- enable_experimental_chat_threaded_discussions: "ניסיוני: לאפשר לצוות לאפשר שרשור על ערוצי צ׳אט, מה שמאפשר להתדיין במקביל בערוץ כאשר משתמשים מגיבים זה לזה."errors:chat_default_channel: "ערוץ הצ׳אט כברירת המחדל חייב להיות ערוץ ציבורי."direct_message_enabled_groups_invalid: "יש לציין לפחות קבוצה אחת בהגדרה הזאת. כדי למנוע מכולם לשלוח הודעות ישירות למעט הסגל, יש לבחור בקבוצת הסגל."diff --git a/plugins/chat/config/locales/server.it.yml b/plugins/chat/config/locales/server.it.ymlindex 29977b0f876..c069e1bc1dc 100644--- a/plugins/chat/config/locales/server.it.yml+++ b/plugins/chat/config/locales/server.it.yml@@ -27,7 +27,6 @@ it:max_mentions_per_chat_message: "Numero massimo di notifiche @name che un utente può utilizzare in un messaggio di chat."chat_max_direct_message_users: "Gli utenti non possono aggiungere più utenti di quelli indicati da questa opzione durante la creazione di un nuovo messaggio diretto. Impostare l'opzione a 0 per consentire solo i messaggi a se stessi. Questa impostazione non si applica allo staff."chat_allow_archiving_channels: "Consenti allo staff di archiviare i messaggi in un argomento alla chiusura di un canale."- enable_experimental_chat_threaded_discussions: "SPERIMENTALE: Consenti al personale di attivare il threading sui canali di chat, che permette di avere discussioni parallele in un canale quando gli utenti rispondono l'uno all'altro."errors:chat_default_channel: "Il canale di chat predefinito deve essere un canale pubblico."direct_message_enabled_groups_invalid: "Devi specificare almeno un gruppo per questa impostazione. Se non vuoi che nessuno al di fuori dello staff possa inviare messaggi diretti, scegli il gruppo dello staff."diff --git a/plugins/chat/config/locales/server.pl_PL.yml b/plugins/chat/config/locales/server.pl_PL.ymlindex 1155776eb09..68047c8ba56 100644--- a/plugins/chat/config/locales/server.pl_PL.yml+++ b/plugins/chat/config/locales/server.pl_PL.yml@@ -26,7 +26,6 @@ pl_PL:max_mentions_per_chat_message: "Maksymalna liczba powiadomień @name, których użytkownik może użyć w wiadomości na czacie."chat_max_direct_message_users: "Użytkownicy nie mogą dodać więcej niż ta liczba innych użytkowników podczas tworzenia nowej wiadomości bezpośredniej. Ustaw na 0, aby zezwolić na wysyłanie wiadomości tylko do siebie. Personel jest zwolniony z tego ustawienia."chat_allow_archiving_channels: "Zezwól personelowi na archiwizowanie wiadomości w temacie podczas zamykania kanału."- enable_experimental_chat_threaded_discussions: "EKSPERYMENTALNE: Zezwól personelowi na włączanie wątków na kanałach czatu, co pozwala na prowadzenie równoległych dyskusji na kanale, gdy użytkownicy odpowiadają sobie nawzajem."errors:chat_default_channel: "Domyślny kanał czatu musi być kanałem publicznym."direct_message_enabled_groups_invalid: "Musisz określić co najmniej jedną grupę dla tego ustawienia. Jeśli nie chcesz, aby ktokolwiek poza personelem wysyłał bezpośrednie wiadomości, wybierz grupę pracowników."diff --git a/plugins/chat/config/locales/server.sv.yml b/plugins/chat/config/locales/server.sv.ymlindex d7ff66eb4ad..440327fa8b5 100644--- a/plugins/chat/config/locales/server.sv.yml+++ b/plugins/chat/config/locales/server.sv.yml@@ -27,7 +27,6 @@ sv:max_mentions_per_chat_message: "Maximalt antal @namnomnämnanden en användare kan göra i ett chattmeddelande."chat_max_direct_message_users: "Användare kan inte lägga till fler än detta antal andra användare när de skapar ett nytt direktmeddelande. Ställ in till 0 för att endast tillåta meddelanden till sig själv. Personalen är undantagen från denna inställning."chat_allow_archiving_channels: "Tillåt att personalen arkiverar meddelanden till ett ämne när en kanal stängs."- enable_experimental_chat_threaded_discussions: "EXPERIMENTELLT: Tillåt att personalen aktiverar trådning på chattkanaler, vilket gör att parallella diskussioner kan uppstå i en kanal när användare svarar varandra."errors:chat_default_channel: "Standardchattkanalen måste vara en offentlig kanal."direct_message_enabled_groups_invalid: "Du måste ange minst en grupp för den här inställningen. Om du inte vill att någon förutom personal ska skicka direktmeddelanden, välj personalgrupp."diff --git a/plugins/chat/config/settings.yml b/plugins/chat/config/settings.ymlindex 97e8575ddb0..e5958c82cde 100644--- a/plugins/chat/config/settings.yml+++ b/plugins/chat/config/settings.yml@@ -116,6 +116,3 @@ chat:max_chat_draft_length:default: 50_000hidden: true- enable_experimental_chat_threaded_discussions:- default: false- client: truediff --git a/plugins/chat/lib/chat/channel_fetcher.rb b/plugins/chat/lib/chat/channel_fetcher.rbindex 9cef651fa23..3f640637561 100644--- a/plugins/chat/lib/chat/channel_fetcher.rb+++ b/plugins/chat/lib/chat/channel_fetcher.rb@@ -245,8 +245,7 @@ module Chatchannel_ids: channel_ids,guardian: guardian,include_missing_memberships: true,- include_threads:- SiteSetting.enable_experimental_chat_threaded_discussions && include_threads,+ include_threads: include_threads,).reportenddiff --git a/plugins/chat/lib/chat/message_mover.rb b/plugins/chat/lib/chat/message_mover.rbindex bdca6b39772..2c7c86d69a1 100644--- a/plugins/chat/lib/chat/message_mover.rb+++ b/plugins/chat/lib/chat/message_mover.rb@@ -25,8 +25,7 @@# into a new channel, they end up as just a flat series of messages that are# not in a chain. If the original message of a thread and N other messages# in that thread, then any messages left behind just get placed into a new-# thread. Message moving will be disabled in the thread UI while-# enable_experimental_chat_threaded_discussions is present, its too complicated+# thread. Message moving will be disabled in the thread UI, its too complicated# to have end users reason about for now, and we may want a standalone# "Move Thread" UI later on.module Chatdiff --git a/plugins/chat/lib/discourse_dev/thread.rb b/plugins/chat/lib/discourse_dev/thread.rbindex 877df561a9d..fefa1264c61 100644--- a/plugins/chat/lib/discourse_dev/thread.rb+++ b/plugins/chat/lib/discourse_dev/thread.rb@@ -13,10 +13,6 @@ module DiscourseDevenddef data- if !SiteSetting.enable_experimental_chat_threaded_discussions- raise "You need to enable_experimental_chat_threaded_discussions to run this task"- end-channel = ::Chat::Channel.find(@channel_id)return if !channeldiff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rbindex f54db49a6bf..b70a660ee45 100644--- a/plugins/chat/plugin.rb+++ b/plugins/chat/plugin.rb@@ -238,15 +238,13 @@ after_initialize doadd_to_serializer(:current_user, :chat_channels) dostructured = Chat::ChannelFetcher.structured(self.scope)- if SiteSetting.enable_experimental_chat_threaded_discussions- structured[:unread_thread_overview] = ::Chat::TrackingStateReportQuery.call(- guardian: self.scope,- channel_ids: structured[:public_channels].map(&:id),- include_threads: true,- include_read: false,- include_last_reply_details: true,- ).thread_unread_overview_by_channel- end+ structured[:unread_thread_overview] = ::Chat::TrackingStateReportQuery.call(+ guardian: self.scope,+ channel_ids: structured[:public_channels].map(&:id),+ include_threads: true,+ include_read: false,+ include_last_reply_details: true,+ ).thread_unread_overview_by_channelChat::ChannelIndexSerializer.new(structured, scope: self.scope, root: false).as_jsonenddiff --git a/plugins/chat/spec/integration/thread_replies_count_cache_accuracy_spec.rb b/plugins/chat/spec/integration/thread_replies_count_cache_accuracy_spec.rbindex a41ad8e2ef8..01df30c356b 100644--- a/plugins/chat/spec/integration/thread_replies_count_cache_accuracy_spec.rb+++ b/plugins/chat/spec/integration/thread_replies_count_cache_accuracy_spec.rb@@ -6,10 +6,7 @@ RSpec.describe "Chat::Thread replies_count cache accuracy" dofab!(:user) { Fabricate(:user) }fab!(:thread) { Fabricate(:chat_thread) }- before do- SiteSetting.chat_enabled = true- SiteSetting.enable_experimental_chat_threaded_discussions = true- end+ before { SiteSetting.chat_enabled = true }it "keeps an accurate replies_count cache" dofreeze_timediff --git a/plugins/chat/spec/jobs/regular/chat/notify_mentioned_spec.rb b/plugins/chat/spec/jobs/regular/chat/notify_mentioned_spec.rbindex 5f2c6f507d2..1810a843168 100644--- a/plugins/chat/spec/jobs/regular/chat/notify_mentioned_spec.rb+++ b/plugins/chat/spec/jobs/regular/chat/notify_mentioned_spec.rb@@ -429,10 +429,7 @@ describe Jobs::Chat::NotifyMentioned doendcontext "when the mention is within a thread" do- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- public_channel.update!(threading_enabled: true)- end+ before { public_channel.update!(threading_enabled: true) }fab!(:thread) { Fabricate(:chat_thread, channel: public_channel) }diff --git a/plugins/chat/spec/jobs/regular/mark_all_channel_threads_read_spec.rb b/plugins/chat/spec/jobs/regular/mark_all_channel_threads_read_spec.rbindex c75a4cf450d..b98db58b589 100644--- a/plugins/chat/spec/jobs/regular/mark_all_channel_threads_read_spec.rb+++ b/plugins/chat/spec/jobs/regular/mark_all_channel_threads_read_spec.rb@@ -2,45 +2,32 @@RSpec.describe Jobs::Chat::MarkAllChannelThreadsRead dofab!(:channel) { Fabricate(:chat_channel, threading_enabled: true) }+ fab!(:thread_1) { Fabricate(:chat_thread, channel: channel) }+ fab!(:thread_2) { Fabricate(:chat_thread, channel: channel) }+ fab!(:user_1) { Fabricate(:user) }+ fab!(:user_2) { Fabricate(:user) }+ fab!(:thread_1_message_1) { Fabricate(:chat_message, thread: thread_1) }+ fab!(:thread_1_message_2) { Fabricate(:chat_message, thread: thread_1) }+ fab!(:thread_1_message_3) { Fabricate(:chat_message, thread: thread_1) }+ fab!(:thread_2_message_1) { Fabricate(:chat_message, thread: thread_2) }+ fab!(:thread_2_message_2) { Fabricate(:chat_message, thread: thread_2) }- context "when enable_experimental_chat_threaded_discussions is false" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "does nothing" do- Chat::Channel.any_instance.expects(:mark_all_threads_as_read).never- described_class.new.execute(channel_id: channel.id)- end+ before do+ channel.add(user_1)+ channel.add(user_2)+ thread_1.add(user_1)+ thread_2.add(user_2)end- context "when enable_experimental_chat_threaded_discussions is true" do- fab!(:thread_1) { Fabricate(:chat_thread, channel: channel) }- fab!(:thread_2) { Fabricate(:chat_thread, channel: channel) }- fab!(:user_1) { Fabricate(:user) }- fab!(:user_2) { Fabricate(:user) }- fab!(:thread_1_message_1) { Fabricate(:chat_message, thread: thread_1) }- fab!(:thread_1_message_2) { Fabricate(:chat_message, thread: thread_1) }- fab!(:thread_1_message_3) { Fabricate(:chat_message, thread: thread_1) }- fab!(:thread_2_message_1) { Fabricate(:chat_message, thread: thread_2) }- fab!(:thread_2_message_2) { Fabricate(:chat_message, thread: thread_2) }-- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.add(user_1)- channel.add(user_2)- thread_1.add(user_1)- thread_2.add(user_2)- end-- def unread_count(user)- Chat::ThreadUnreadsQuery.call(channel_ids: [channel.id], user_id: user.id).first.unread_count- end+ def unread_count(user)+ Chat::ThreadUnreadsQuery.call(channel_ids: [channel.id], user_id: user.id).first.unread_count+ end- it "marks all threads as read across all users in the channel" do- expect(unread_count(user_1)).to eq(3)- expect(unread_count(user_2)).to eq(2)- described_class.new.execute(channel_id: channel.id)- expect(unread_count(user_1)).to eq(0)- expect(unread_count(user_2)).to eq(0)- end+ it "marks all threads as read across all users in the channel" do+ expect(unread_count(user_1)).to eq(3)+ expect(unread_count(user_2)).to eq(2)+ described_class.new.execute(channel_id: channel.id)+ expect(unread_count(user_1)).to eq(0)+ expect(unread_count(user_2)).to eq(0)endenddiff --git a/plugins/chat/spec/jobs/regular/update_thread_reply_count_spec.rb b/plugins/chat/spec/jobs/regular/update_thread_reply_count_spec.rbindex fc2d0082a90..8c844c4fad8 100644--- a/plugins/chat/spec/jobs/regular/update_thread_reply_count_spec.rb+++ b/plugins/chat/spec/jobs/regular/update_thread_reply_count_spec.rb@@ -5,16 +5,7 @@ RSpec.describe Jobs::Chat::UpdateThreadReplyCount dofab!(:message_1) { Fabricate(:chat_message, thread: thread) }fab!(:message_2) { Fabricate(:chat_message, thread: thread) }- before do- Chat::Thread.clear_caches!(thread.id)- SiteSetting.enable_experimental_chat_threaded_discussions = true- end-- it "does nothing if enable_experimental_chat_threaded_discussions is false" do- SiteSetting.enable_experimental_chat_threaded_discussions = false- Chat::Thread.any_instance.expects(:set_replies_count_cache).never- described_class.new.execute(thread_id: thread.id)- end+ before { Chat::Thread.clear_caches!(thread.id) }it "does not error if the thread is deleted" doid = thread.iddiff --git a/plugins/chat/spec/models/chat/thread_spec.rb b/plugins/chat/spec/models/chat/thread_spec.rbindex 1ea74c5a7a8..cc9483df9b7 100644--- a/plugins/chat/spec/models/chat/thread_spec.rb+++ b/plugins/chat/spec/models/chat/thread_spec.rb@@ -1,10 +1,7 @@# frozen_string_literal: trueRSpec.describe Chat::Thread do- before do- SiteSetting.chat_enabled = true- SiteSetting.enable_experimental_chat_threaded_discussions = true- end+ before { SiteSetting.chat_enabled = true }describe ".ensure_consistency!" dofab!(:channel) { Fabricate(:category_channel) }@@ -65,12 +62,6 @@ RSpec.describe Chat::Thread doChat::Thread.expects(:clear_caches!).neverdescribed_class.ensure_consistency!end-- it "does nothing if threads are disabled" do- SiteSetting.enable_experimental_chat_threaded_discussions = false- Chat::Thread.expects(:update_counts).never- described_class.ensure_consistency!- endendenddiff --git a/plugins/chat/spec/queries/chat/thread_unreads_query_spec.rb b/plugins/chat/spec/queries/chat/thread_unreads_query_spec.rbindex 1d0cf52b63c..9970d7e4eef 100644--- a/plugins/chat/spec/queries/chat/thread_unreads_query_spec.rb+++ b/plugins/chat/spec/queries/chat/thread_unreads_query_spec.rb@@ -29,7 +29,6 @@ describe Chat::ThreadUnreadsQuery dobefore doSiteSetting.chat_enabled = true- SiteSetting.enable_experimental_chat_threaded_discussions = trueSiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]channel_1.add(current_user)channel_2.add(current_user)diff --git a/plugins/chat/spec/requests/chat/api/channel_threads_controller_spec.rb b/plugins/chat/spec/requests/chat/api/channel_threads_controller_spec.rbindex 73f62b58c43..f3e4f40a300 100644--- a/plugins/chat/spec/requests/chat/api/channel_threads_controller_spec.rb+++ b/plugins/chat/spec/requests/chat/api/channel_threads_controller_spec.rb@@ -9,7 +9,6 @@ RSpec.describe Chat::Api::ChannelThreadsController dobefore doSiteSetting.chat_enabled = trueSiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]- SiteSetting.enable_experimental_chat_threaded_discussions = trueGroup.refresh_automatic_groups!sign_in(current_user)end@@ -62,15 +61,6 @@ RSpec.describe Chat::Api::ChannelThreadsController doendend- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "returns 404" do- get "/chat/api/channels/#{thread.channel_id}/threads/#{thread.id}"- expect(response.status).to eq(404)- end- end-context "when user cannot access the channel" dobefore dothread.channel.update!(chatable: Fabricate(:private_category, group: Fabricate(:group)))@@ -175,15 +165,6 @@ RSpec.describe Chat::Api::ChannelThreadsController doexpect(response.status).to eq(404)endend-- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "returns 404" do- get "/chat/api/channels/#{public_channel.id}/threads"- expect(response.status).to eq(404)- end- endenddescribe "update" do@@ -247,14 +228,5 @@ RSpec.describe Chat::Api::ChannelThreadsController doexpect(response.status).to eq(404)endend-- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "returns 404" do- put "/chat/api/channels/#{thread.channel_id}/threads/#{thread.id}", params: params- expect(response.status).to eq(404)- end- endendenddiff --git a/plugins/chat/spec/requests/chat/api/channels_controller_spec.rb b/plugins/chat/spec/requests/chat/api/channels_controller_spec.rbindex ad8c3275047..036452ee43d 100644--- a/plugins/chat/spec/requests/chat/api/channels_controller_spec.rb+++ b/plugins/chat/spec/requests/chat/api/channels_controller_spec.rb@@ -906,8 +906,6 @@ RSpec.describe Chat::Api::ChannelsController doenddescribe "when updating threading_enabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-it "sets the new value" doexpect {put "/chat/api/channels/#{channel.id}", params: { channel: { threading_enabled: true } }diff --git a/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb b/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rbindex 89abcb42bc9..a3baad0d96a 100644--- a/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb+++ b/plugins/chat/spec/serializer/chat/chat_message_serializer_spec.rb@@ -233,20 +233,8 @@ describe Chat::MessageSerializer dodescribe "threading data" dobefore { message_1.update!(thread: Fabricate(:chat_thread, channel: chat_channel)) }- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "does not include thread data" do- serialized = described_class.new(message_1, scope: guardian, root: nil).as_json- expect(serialized).not_to have_key(:thread_id)- end- end-context "when the channel has threading_enabled false" do- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- chat_channel.update!(threading_enabled: false)- end+ before { chat_channel.update!(threading_enabled: false) }it "does not include thread data" doserialized = described_class.new(message_1, scope: guardian, root: nil).as_json@@ -254,11 +242,8 @@ describe Chat::MessageSerializer doendend- context "when the channel has threading_enabled true and enable_experimental_chat_threaded_discussions is true" do- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- chat_channel.update!(threading_enabled: true)- end+ context "when the channel has threading_enabled true" do+ before { chat_channel.update!(threading_enabled: true) }it "does include thread data" doserialized = described_class.new(message_1, scope: guardian, root: nil).as_jsondiff --git a/plugins/chat/spec/services/chat/channel_view_builder_spec.rb b/plugins/chat/spec/services/chat/channel_view_builder_spec.rbindex 71e925ca6b1..47a0f88fef8 100644--- a/plugins/chat/spec/services/chat/channel_view_builder_spec.rb+++ b/plugins/chat/spec/services/chat/channel_view_builder_spec.rb@@ -112,11 +112,8 @@ RSpec.describe Chat::ChannelViewBuilder doit { is_expected.to fail_a_contract }end- context "when channel has threading_enabled and enable_experimental_chat_threaded_discussions is true" do- before do- channel.update!(threading_enabled: true)- SiteSetting.enable_experimental_chat_threaded_discussions = true- end+ context "when channel has threading_enabled true" do+ before { channel.update!(threading_enabled: true) }it "threads_enabled is true" doexpect(result.threads_enabled).to eq(true)@@ -320,10 +317,7 @@ RSpec.describe Chat::ChannelViewBuilder doendcontext "when not including thread messages" do- before do- channel.update!(threading_enabled: true)- SiteSetting.enable_experimental_chat_threaded_discussions = true- end+ before { channel.update!(threading_enabled: true) }it "does not include the target message" doexpect(result.view.chat_messages).to eq(diff --git a/plugins/chat/spec/services/chat/lookup_channel_threads_spec.rb b/plugins/chat/spec/services/chat/lookup_channel_threads_spec.rbindex bad3021add4..1727a8adc4a 100644--- a/plugins/chat/spec/services/chat/lookup_channel_threads_spec.rb+++ b/plugins/chat/spec/services/chat/lookup_channel_threads_spec.rb@@ -15,16 +15,6 @@ RSpec.describe ::Chat::LookupChannelThreads dolet(:offset) { 0 }let(:params) { { guardian: guardian, channel_id: channel_id, limit: limit, offset: offset } }- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-- describe "policy - threaded_discussions_enabled" do- context "when disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it { is_expected.to fail_a_policy(:threaded_discussions_enabled) }- end- end-describe "step - set_limit" dofab!(:channel_1) { Fabricate(:chat_channel) }let(:channel_id) { channel_1.id }diff --git a/plugins/chat/spec/services/chat/lookup_thread_spec.rb b/plugins/chat/spec/services/chat/lookup_thread_spec.rbindex c71c68d3d07..a6c806a394e 100644--- a/plugins/chat/spec/services/chat/lookup_thread_spec.rb+++ b/plugins/chat/spec/services/chat/lookup_thread_spec.rb@@ -18,54 +18,44 @@ RSpec.describe Chat::LookupThread dolet(:guardian) { Guardian.new(current_user) }let(:params) { { guardian: guardian, thread_id: thread.id, channel_id: thread.channel_id } }- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it { is_expected.to fail_a_policy(:threaded_discussions_enabled) }- end-- context "when enable_experimental_chat_threaded_discussions is enabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-- context "when all steps pass" do- it "sets the service result as successful" do- expect(result).to be_a_success- end+ context "when all steps pass" do+ it "sets the service result as successful" do+ expect(result).to be_a_success+ end- it "fetches the thread" do- expect(result.thread).to eq(thread)- end+ it "fetches the thread" do+ expect(result.thread).to eq(thread)end+ end- context "when params are not valid" do- before { params.delete(:thread_id) }+ context "when params are not valid" do+ before { params.delete(:thread_id) }- it { is_expected.to fail_a_contract }- end+ it { is_expected.to fail_a_contract }+ end- context "when thread is not found because the channel ID differs" do- before { params[:thread_id] = other_thread.id }+ context "when thread is not found because the channel ID differs" do+ before { params[:thread_id] = other_thread.id }- it { is_expected.to fail_to_find_a_model(:thread) }- end+ it { is_expected.to fail_to_find_a_model(:thread) }+ end- context "when thread is not found" do- before { thread.destroy! }+ context "when thread is not found" do+ before { thread.destroy! }- it { is_expected.to fail_to_find_a_model(:thread) }- end+ it { is_expected.to fail_to_find_a_model(:thread) }+ end- context "when user cannot see channel" do- before { thread.update!(channel: private_channel) }+ context "when user cannot see channel" do+ before { thread.update!(channel: private_channel) }- it { is_expected.to fail_a_policy(:invalid_access) }- end+ it { is_expected.to fail_a_policy(:invalid_access) }+ end- context "when threading is not enabled for the channel" do- before { channel.update!(threading_enabled: false) }+ context "when threading is not enabled for the channel" do+ before { channel.update!(threading_enabled: false) }- it { is_expected.to fail_a_policy(:threading_enabled_for_channel) }- end+ it { is_expected.to fail_a_policy(:threading_enabled_for_channel) }endendenddiff --git a/plugins/chat/spec/services/chat/publisher_spec.rb b/plugins/chat/spec/services/chat/publisher_spec.rbindex 0f966c41905..0385cb0e95d 100644--- a/plugins/chat/spec/services/chat/publisher_spec.rb+++ b/plugins/chat/spec/services/chat/publisher_spec.rb@@ -32,7 +32,6 @@ describe Chat::Publisher docontext "when the message is in a thread and the channel has threading_enabled" dobefore do- SiteSetting.enable_experimental_chat_threaded_discussions = truethread = Fabricate(:chat_thread, channel: channel)message_1.update!(thread: thread)message_2.update!(thread: thread)@@ -130,48 +129,8 @@ describe Chat::Publisher doenddescribe ".calculate_publish_targets" do- context "when enable_experimental_chat_threaded_discussions is false" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- context "when the message is the original message of a thread" do- fab!(:thread) { Fabricate(:chat_thread, original_message: message_1, channel: channel) }-- it "generates the correct targets" do- targets = described_class.calculate_publish_targets(channel, message_1)- expect(targets).to contain_exactly("/chat/#{channel.id}")- end- end-- context "when the message is a thread reply" do- fab!(:thread) do- Fabricate(- :chat_thread,- original_message: Fabricate(:chat_message, chat_channel: channel),- channel: channel,- )- end-- before { message_1.update!(thread: thread) }-- it "generates the correct targets" do- targets = described_class.calculate_publish_targets(channel, message_1)- expect(targets).to contain_exactly("/chat/#{channel.id}")- end- end-- context "when the message is not part of a thread" do- it "generates the correct targets" do- targets = described_class.calculate_publish_targets(channel, message_1)- expect(targets).to contain_exactly("/chat/#{channel.id}")- end- end- end-context "when threading_enabled is false for the channel" do- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.update!(threading_enabled: false)- end+ before { channel.update!(threading_enabled: false) }context "when the message is the original message of a thread" dofab!(:thread) { Fabricate(:chat_thread, original_message: message_1, channel: channel) }@@ -207,11 +166,8 @@ describe Chat::Publisher doendend- context "when enable_experimental_chat_threaded_discussions is true and threading_enabled is true for the channel" do- before do- channel.update!(threading_enabled: true)- SiteSetting.enable_experimental_chat_threaded_discussions = true- end+ context "when threading_enabled is true for the channel" do+ before { channel.update!(threading_enabled: true) }context "when the message is the original message of a thread" dofab!(:thread) { Fabricate(:chat_thread, original_message: message_1, channel: channel) }@@ -312,8 +268,8 @@ describe Chat::Publisher dobefore { message_1.update!(thread: thread) }- context "if enable_experimental_chat_threaded_discussions is false" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }+ context "if threading_enabled is false for the channel" do+ before { channel.update!(threading_enabled: false) }it "publishes to the new_messages_message_bus_channel" domessages =@@ -322,22 +278,6 @@ describe Chat::Publisher do) { described_class.publish_new!(channel, message_1, staged_id) }expect(messages).not_to be_emptyend- end-- context "if enable_experimental_chat_threaded_discussions is true" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-- context "if threading_enabled is false for the channel" do- before { channel.update!(threading_enabled: false) }-- it "publishes to the new_messages_message_bus_channel" do- messages =- MessageBus.track_publish(- described_class.new_messages_message_bus_channel(channel.id),- ) { described_class.publish_new!(channel, message_1, staged_id) }- expect(messages).not_to be_empty- end- endcontext "if threading_enabled is true for the channel" dobefore { channel.update!(threading_enabled: true) }diff --git a/plugins/chat/spec/services/chat/tracking_state_spec.rb b/plugins/chat/spec/services/chat/tracking_state_spec.rbindex 6fedc57737a..f68a3f288cb 100644--- a/plugins/chat/spec/services/chat/tracking_state_spec.rb+++ b/plugins/chat/spec/services/chat/tracking_state_spec.rb@@ -14,7 +14,7 @@ RSpec.describe ::Chat::TrackingState dolet(:guardian) { Guardian.new(current_user) }let(:id_params) { { channel_ids: [channel_1.id], thread_ids: [thread_1.id] } }- let(:include_threads) { nil }+ let(:include_threads) { true }let(:include_missing_memberships) { nil }let(:params) do@@ -24,87 +24,52 @@ RSpec.describe ::Chat::TrackingState do)end- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- context "when include_threads is true" do- let(:include_threads) { true }- it { is_expected.to fail_a_policy(:threaded_discussions_settings_ok) }- end-- context "when include_threads is false" do- let(:include_threads) { false }- it { is_expected.not_to fail_a_policy(:threaded_discussions_settings_ok) }- end+ fab!(:channel_1_membership) do+ Fabricate(:user_chat_channel_membership, chat_channel: channel_1, user: current_user)+ end+ fab!(:thread_1_membership) do+ Fabricate(:user_chat_thread_membership, thread: thread_1, user: current_user)+ end+ fab!(:thread_2_membership) do+ Fabricate(:user_chat_thread_membership, thread: thread_2, user: current_user)end- context "when enable_experimental_chat_threaded_discussions is enabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-- let(:include_threads) { true }- fab!(:channel_1_membership) do- Fabricate(:user_chat_channel_membership, chat_channel: channel_1, user: current_user)- end- fab!(:thread_1_membership) do- Fabricate(:user_chat_thread_membership, thread: thread_1, user: current_user)- end- fab!(:thread_2_membership) do- Fabricate(:user_chat_thread_membership, thread: thread_2, user: current_user)- end-- context "when not including channels and threads where the user is not a member" do- context "when only channel_ids are provided" do- let(:id_params) { { channel_ids: [channel_1.id, channel_2.id] } }-- it "gets the tracking state of the channels" do- generate_tracking_state- expect(result.report.channel_tracking).to eq(- channel_1.id => {- unread_count: 4, # 2 messages + 2 thread original messages- mention_count: 0,- },- )- end+ context "when not including channels and threads where the user is not a member" do+ context "when only channel_ids are provided" do+ let(:id_params) { { channel_ids: [channel_1.id, channel_2.id] } }- it "gets the tracking state of the threads in the channels" do- generate_tracking_state- expect(result.report.thread_tracking).to eq(- thread_1.id => {- channel_id: channel_1.id,- unread_count: 1,- mention_count: 0,- },- thread_2.id => {- channel_id: channel_1.id,- unread_count: 2,- mention_count: 0,- },- )- end+ it "gets the tracking state of the channels" do+ generate_tracking_state+ expect(result.report.channel_tracking).to eq(+ channel_1.id => {+ unread_count: 4, # 2 messages + 2 thread original messages+ mention_count: 0,+ },+ )+ end- context "when include_threads is false" do- let(:include_threads) { false }-- it "only gets channel tracking state and no thread tracking state" do- generate_tracking_state- expect(result.report.thread_tracking).to eq({})- expect(result.report.channel_tracking).to eq(- channel_1.id => {- unread_count: 4, # 2 messages + 2 thread original messages- mention_count: 0,- },- )- end- end+ it "gets the tracking state of the threads in the channels" do+ generate_tracking_state+ expect(result.report.thread_tracking).to eq(+ thread_1.id => {+ channel_id: channel_1.id,+ unread_count: 1,+ mention_count: 0,+ },+ thread_2.id => {+ channel_id: channel_1.id,+ unread_count: 2,+ mention_count: 0,+ },+ )end- context "when thread_ids and channel_ids are provided" do- let(:id_params) do- { channel_ids: [channel_1.id, channel_2.id], thread_ids: [thread_2.id] }- end+ context "when include_threads is false" do+ let(:include_threads) { false }- it "gets the tracking state of the channels" do+ it "only gets channel tracking state and no thread tracking state" dogenerate_tracking_state+ expect(result.report.thread_tracking).to eq({})expect(result.report.channel_tracking).to eq(channel_1.id => {unread_count: 4, # 2 messages + 2 thread original messages@@ -112,66 +77,80 @@ RSpec.describe ::Chat::TrackingState do},)end-- it "only gets the tracking state of the specified threads in the channels" do- generate_tracking_state- expect(result.report.thread_tracking).to eq(- thread_2.id => {- channel_id: channel_1.id,- unread_count: 2,- mention_count: 0,- },- )- endendend- context "when including channels and threads where the user is not a member" do- let(:id_params) { { channel_ids: [channel_1.id, channel_2.id] } }- let(:include_missing_memberships) { true }- let(:include_threads) { true }+ context "when thread_ids and channel_ids are provided" do+ let(:id_params) { { channel_ids: [channel_1.id, channel_2.id], thread_ids: [thread_2.id] } }- it "gets the tracking state of all channels including the ones where the user is not a member" do+ it "gets the tracking state of the channels" dogenerate_tracking_stateexpect(result.report.channel_tracking).to eq(channel_1.id => {unread_count: 4, # 2 messages + 2 thread original messagesmention_count: 0,},- channel_2.id => {- unread_count: 0,- mention_count: 0,- },)end- it "gets the tracking state of all the threads in the channels including the ones where the user is not a member" do+ it "only gets the tracking state of the specified threads in the channels" dogenerate_tracking_stateexpect(result.report.thread_tracking).to eq(- thread_1.id => {- channel_id: channel_1.id,- unread_count: 1,- mention_count: 0,- },thread_2.id => {channel_id: channel_1.id,unread_count: 2,mention_count: 0,},- thread_3.id => {- channel_id: channel_2.id,- unread_count: 0,- mention_count: 0,- },- thread_4.id => {- channel_id: channel_2.id,- unread_count: 0,- mention_count: 0,- },)endendend++ context "when including channels and threads where the user is not a member" do+ let(:id_params) { { channel_ids: [channel_1.id, channel_2.id] } }+ let(:include_missing_memberships) { true }+ let(:include_threads) { true }++ it "gets the tracking state of all channels including the ones where the user is not a member" do+ generate_tracking_state+ expect(result.report.channel_tracking).to eq(+ channel_1.id => {+ unread_count: 4, # 2 messages + 2 thread original messages+ mention_count: 0,+ },+ channel_2.id => {+ unread_count: 0,+ mention_count: 0,+ },+ )+ end++ it "gets the tracking state of all the threads in the channels including the ones where the user is not a member" do+ generate_tracking_state+ expect(result.report.thread_tracking).to eq(+ thread_1.id => {+ channel_id: channel_1.id,+ unread_count: 1,+ mention_count: 0,+ },+ thread_2.id => {+ channel_id: channel_1.id,+ unread_count: 2,+ mention_count: 0,+ },+ thread_3.id => {+ channel_id: channel_2.id,+ unread_count: 0,+ mention_count: 0,+ },+ thread_4.id => {+ channel_id: channel_2.id,+ unread_count: 0,+ mention_count: 0,+ },+ )+ end+ endenddef generate_tracking_statediff --git a/plugins/chat/spec/services/chat/update_thread_spec.rb b/plugins/chat/spec/services/chat/update_thread_spec.rbindex ac85592aabd..2d5c121ba31 100644--- a/plugins/chat/spec/services/chat/update_thread_spec.rb+++ b/plugins/chat/spec/services/chat/update_thread_spec.rb@@ -21,85 +21,75 @@ RSpec.describe Chat::UpdateThread do{ guardian: guardian, thread_id: thread.id, channel_id: thread.channel_id, title: title }end- context "when enable_experimental_chat_threaded_discussions is disabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it { is_expected.to fail_a_policy(:threaded_discussions_enabled) }- end-- context "when enable_experimental_chat_threaded_discussions is enabled" do- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-- context "when all steps pass" do- it "sets the service result as successful" do- expect(result).to be_a_success- end-- it "updates the title of the thread" do- result- expect(thread.reload.title).to eq(title)- end-- it "publishes a MessageBus message" do- message =- MessageBus- .track_publish(Chat::Publisher.root_message_bus_channel(thread.channel_id)) { result }- .first+ context "when all steps pass" do+ it "sets the service result as successful" do+ expect(result).to be_a_success+ end- expect(message.data["type"]).to eq("update_thread_original_message")- end+ it "updates the title of the thread" do+ result+ expect(thread.reload.title).to eq(title)end- context "when params are not valid" do- before { params.delete(:thread_id) }+ it "publishes a MessageBus message" do+ message =+ MessageBus+ .track_publish(Chat::Publisher.root_message_bus_channel(thread.channel_id)) { result }+ .first- it { is_expected.to fail_a_contract }+ expect(message.data["type"]).to eq("update_thread_original_message")end+ end- context "when title is too long" do- let(:title) { "a" * Chat::Thread::MAX_TITLE_LENGTH + "a" }+ context "when params are not valid" do+ before { params.delete(:thread_id) }- it { is_expected.to fail_a_contract }- end+ it { is_expected.to fail_a_contract }+ end- context "when thread is not found because the channel ID differs" do- before { params[:thread_id] = other_thread.id }+ context "when title is too long" do+ let(:title) { "a" * Chat::Thread::MAX_TITLE_LENGTH + "a" }- it { is_expected.to fail_to_find_a_model(:thread) }- end+ it { is_expected.to fail_a_contract }+ end- context "when thread is not found" do- before { thread.destroy! }+ context "when thread is not found because the channel ID differs" do+ before { params[:thread_id] = other_thread.id }- it { is_expected.to fail_to_find_a_model(:thread) }- end+ it { is_expected.to fail_to_find_a_model(:thread) }+ end- context "when user cannot see channel" do- before { thread.update!(channel: private_channel) }+ context "when thread is not found" do+ before { thread.destroy! }- it { is_expected.to fail_a_policy(:can_view_channel) }- end+ it { is_expected.to fail_to_find_a_model(:thread) }+ end- context "when user is not the thread original message creator" do- before { thread.update!(original_message_user: Fabricate(:user)) }+ context "when user cannot see channel" do+ before { thread.update!(channel: private_channel) }- it { is_expected.to fail_a_policy(:can_edit_thread) }- end+ it { is_expected.to fail_a_policy(:can_view_channel) }+ end- context "when user is not the thread original message creator but they are staff" do- before do- thread.original_message.update!(user: Fabricate(:user))- current_user.update!(admin: true)- end+ context "when user is not the thread original message creator" do+ before { thread.update!(original_message_user: Fabricate(:user)) }- it { is_expected.not_to fail_a_policy(:can_edit_thread) }+ it { is_expected.to fail_a_policy(:can_edit_thread) }+ end++ context "when user is not the thread original message creator but they are staff" do+ before do+ thread.original_message.update!(user: Fabricate(:user))+ current_user.update!(admin: true)end- context "when threading is not enabled for the channel" do- before { channel.update!(threading_enabled: false) }+ it { is_expected.not_to fail_a_policy(:can_edit_thread) }+ end- it { is_expected.to fail_a_policy(:threading_enabled_for_channel) }- end+ context "when threading is not enabled for the channel" do+ before { channel.update!(threading_enabled: false) }++ it { is_expected.to fail_a_policy(:threading_enabled_for_channel) }endendenddiff --git a/plugins/chat/spec/system/channel_settings_page_spec.rb b/plugins/chat/spec/system/channel_settings_page_spec.rbindex 929174aa467..5196a3e8856 100644--- a/plugins/chat/spec/system/channel_settings_page_spec.rb+++ b/plugins/chat/spec/system/channel_settings_page_spec.rb@@ -178,7 +178,6 @@ RSpec.describe "Channel - Info - Settings page", type: :system doendit "can enable threading" do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_page.visit_channel_settings(channel_1)expect {diff --git a/plugins/chat/spec/system/channel_thread_message_echoing_spec.rb b/plugins/chat/spec/system/channel_thread_message_echoing_spec.rbindex 008d1cebddb..52f4c25739e 100644--- a/plugins/chat/spec/system/channel_thread_message_echoing_spec.rb+++ b/plugins/chat/spec/system/channel_thread_message_echoing_spec.rb@@ -15,25 +15,9 @@ describe "Channel thread message echoing", type: :system dosign_in(current_user)end- context "when enable_experimental_chat_threaded_discussions is disabled" do- fab!(:channel) { Fabricate(:chat_channel) }- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "echoes the thread messages into the main channel stream" do- thread = chat_thread_chain_bootstrap(channel: channel, users: [current_user, other_user])- chat_page.visit_channel(channel)- thread.chat_messages.each do |thread_message|- expect(channel_page).to have_css(channel_page.message_by_id_selector(thread_message.id))- end- end- end-context "when threading_enabled is false for the channel" dofab!(:channel) { Fabricate(:chat_channel) }- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.update!(threading_enabled: false)- end+ before { channel.update!(threading_enabled: false) }it "echoes the thread messages into the main channel stream" dothread = chat_thread_chain_bootstrap(channel: channel, users: [current_user, other_user])@@ -44,16 +28,13 @@ describe "Channel thread message echoing", type: :system doendend- context "when enable_experimental_chat_threaded_discussions is true and threading is enabled for the channel" do+ context "when threading is enabled for the channel" dofab!(:channel) { Fabricate(:chat_channel) }fab!(:thread) dochat_thread_chain_bootstrap(channel: channel, users: [current_user, other_user])end- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.update!(threading_enabled: true)- end+ before { channel.update!(threading_enabled: true) }it "does not echo the thread messages except for the original message into the channel stream" dochat_page.visit_channel(channel)diff --git a/plugins/chat/spec/system/chat/composer/channel_spec.rb b/plugins/chat/spec/system/chat/composer/channel_spec.rbindex 92d2630bee5..0143aae7107 100644--- a/plugins/chat/spec/system/chat/composer/channel_spec.rb+++ b/plugins/chat/spec/system/chat/composer/channel_spec.rb@@ -38,10 +38,7 @@ RSpec.describe "Chat | composer | channel", type: :system, js: true doendcontext "when threading is enabled" do- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel_1.update!(threading_enabled: true)- end+ before { channel_1.update!(threading_enabled: true) }it "replies in the thread" dochat_page.visit_channel(channel_1)diff --git a/plugins/chat/spec/system/chat/composer/shortcuts/channel_spec.rb b/plugins/chat/spec/system/chat/composer/shortcuts/channel_spec.rbindex e3b69116fbc..fcd2524f22c 100644--- a/plugins/chat/spec/system/chat/composer/shortcuts/channel_spec.rb+++ b/plugins/chat/spec/system/chat/composer/shortcuts/channel_spec.rb@@ -54,10 +54,7 @@ RSpec.describe "Chat | composer | shortcuts | channel", type: :system do)end- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel_1.update!(threading_enabled: true)- end+ before { channel_1.update!(threading_enabled: true) }it "directs the shortcut to the focused composer" dochat.visit_channel(channel_1)diff --git a/plugins/chat/spec/system/chat/composer/shortcuts/thread_spec.rb b/plugins/chat/spec/system/chat/composer/shortcuts/thread_spec.rbindex 573412efe80..860d52063ae 100644--- a/plugins/chat/spec/system/chat/composer/shortcuts/thread_spec.rb+++ b/plugins/chat/spec/system/chat/composer/shortcuts/thread_spec.rb@@ -11,7 +11,6 @@ RSpec.describe "Chat | composer | shortcuts | thread", type: :system dolet(:side_panel_page) { PageObjects::Pages::ChatSidePanel.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.add(current_user)sign_in(current_user)diff --git a/plugins/chat/spec/system/chat/composer/thread_spec.rb b/plugins/chat/spec/system/chat/composer/thread_spec.rbindex aa8730cbada..708fb5e221f 100644--- a/plugins/chat/spec/system/chat/composer/thread_spec.rb+++ b/plugins/chat/spec/system/chat/composer/thread_spec.rb@@ -13,7 +13,6 @@ RSpec.describe "Chat | composer | thread", type: :system, js: true dolet(:thread_page) { PageObjects::Pages::ChatThread.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.add(current_user)sign_in(current_user)diff --git a/plugins/chat/spec/system/chat_message/channel_spec.rb b/plugins/chat/spec/system/chat_message/channel_spec.rbindex e6a9b26ee96..5f3c6778ab8 100644--- a/plugins/chat/spec/system/chat_message/channel_spec.rb+++ b/plugins/chat/spec/system/chat_message/channel_spec.rb@@ -39,10 +39,7 @@ RSpec.describe "Chat message - channel", type: :system doendcontext "when the message is part of a thread" do- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel_1.update!(threading_enabled: true)- end+ before { channel_1.update!(threading_enabled: true) }fab!(:thread_1) dochat_thread_chain_bootstrap(diff --git a/plugins/chat/spec/system/chat_message/thread_spec.rb b/plugins/chat/spec/system/chat_message/thread_spec.rbindex 97a69c2ab80..6aaa9d047f6 100644--- a/plugins/chat/spec/system/chat_message/thread_spec.rb+++ b/plugins/chat/spec/system/chat_message/thread_spec.rb@@ -18,7 +18,6 @@ RSpec.describe "Chat message - thread", type: :system dochannel_1.update!(threading_enabled: true)channel_1.add(current_user)channel_1.add(other_user)- SiteSetting.enable_experimental_chat_threaded_discussions = truesign_in(current_user)enddiff --git a/plugins/chat/spec/system/create_channel_spec.rb b/plugins/chat/spec/system/create_channel_spec.rbindex 2b6fe007def..0b10a181321 100644--- a/plugins/chat/spec/system/create_channel_spec.rb+++ b/plugins/chat/spec/system/create_channel_spec.rb@@ -33,8 +33,6 @@ RSpec.describe "Create channel", type: :system doendit "shows threading toggle" do- SiteSetting.enable_experimental_chat_threaded_discussions = true-chat_page.visit_browsechat_page.new_channel_button.clickchannel_modal.select_category(category_1)diff --git a/plugins/chat/spec/system/deleted_message_spec.rb b/plugins/chat/spec/system/deleted_message_spec.rbindex da52c50694e..4eb97b3e09d 100644--- a/plugins/chat/spec/system/deleted_message_spec.rb+++ b/plugins/chat/spec/system/deleted_message_spec.rb@@ -118,7 +118,6 @@ RSpec.describe "Deleted message", type: :system dobefore dochannel_1.update!(threading_enabled: true)- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_user_bootstrap(user: other_user, channel: channel_1)Chat::Thread.update_countsenddiff --git a/plugins/chat/spec/system/message_thread_indicator_spec.rb b/plugins/chat/spec/system/message_thread_indicator_spec.rbindex 7f48f94d0e9..ab3af576cb3 100644--- a/plugins/chat/spec/system/message_thread_indicator_spec.rb+++ b/plugins/chat/spec/system/message_thread_indicator_spec.rb@@ -15,23 +15,9 @@ describe "Thread indicator for chat messages", type: :system dosign_in(current_user)end- context "when enable_experimental_chat_threaded_discussions is disabled" do- fab!(:channel) { Fabricate(:chat_channel) }- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "shows no thread indicators in the channel" do- thread = chat_thread_chain_bootstrap(channel: channel, users: [current_user, other_user])- chat_page.visit_channel(channel)- expect(channel_page).to have_no_thread_indicator(thread.original_message)- end- end-context "when threading_enabled is false for the channel" dofab!(:channel) { Fabricate(:chat_channel) }- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.update!(threading_enabled: false)- end+ before { channel.update!(threading_enabled: false) }it "shows no thread inidcators in the channel" dothread = chat_thread_chain_bootstrap(channel: channel, users: [current_user, other_user])@@ -40,7 +26,7 @@ describe "Thread indicator for chat messages", type: :system doendend- context "when enable_experimental_chat_threaded_discussions is true and threading is enabled for the channel" do+ context "when threading is enabled for the channel" dofab!(:channel) { Fabricate(:chat_channel) }fab!(:thread_1) dochat_thread_chain_bootstrap(channel: channel, users: [current_user, other_user])@@ -53,10 +39,7 @@ describe "Thread indicator for chat messages", type: :system do)end- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.update!(threading_enabled: true)- end+ before { channel.update!(threading_enabled: true) }it "throws thread indicators on all original messages" dochat_page.visit_channel(channel)diff --git a/plugins/chat/spec/system/navigation_spec.rb b/plugins/chat/spec/system/navigation_spec.rbindex 6fa84a9ba38..40bead2f3d0 100644--- a/plugins/chat/spec/system/navigation_spec.rb+++ b/plugins/chat/spec/system/navigation_spec.rb@@ -135,7 +135,6 @@ RSpec.describe "Navigation", type: :system dofab!(:thread) { Fabricate(:chat_thread, channel: category_channel) }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truecategory_channel.update!(threading_enabled: true)Fabricate(:chat_message, thread: thread, chat_channel: thread.channel)thread.add(current_user)diff --git a/plugins/chat/spec/system/reply_to_message/drawer_spec.rb b/plugins/chat/spec/system/reply_to_message/drawer_spec.rbindex 6e37b9700b7..7d327511cf2 100644--- a/plugins/chat/spec/system/reply_to_message/drawer_spec.rb+++ b/plugins/chat/spec/system/reply_to_message/drawer_spec.rb@@ -18,7 +18,6 @@ RSpec.describe "Reply to message - channel - drawer", type: :system doendbefore do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.update!(threading_enabled: true)channel_1.add(current_user)diff --git a/plugins/chat/spec/system/reply_to_message/full_page_spec.rb b/plugins/chat/spec/system/reply_to_message/full_page_spec.rbindex fcc1a9772b8..0a337604d12 100644--- a/plugins/chat/spec/system/reply_to_message/full_page_spec.rb+++ b/plugins/chat/spec/system/reply_to_message/full_page_spec.rb@@ -18,7 +18,6 @@ RSpec.describe "Reply to message - channel - full page", type: :system doendbefore do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.add(current_user)sign_in(current_user)diff --git a/plugins/chat/spec/system/reply_to_message/mobile_spec.rb b/plugins/chat/spec/system/reply_to_message/mobile_spec.rbindex 73a06556b93..b425cb363aa 100644--- a/plugins/chat/spec/system/reply_to_message/mobile_spec.rb+++ b/plugins/chat/spec/system/reply_to_message/mobile_spec.rb@@ -18,7 +18,6 @@ RSpec.describe "Reply to message - channel - mobile", type: :system, mobile: truendbefore do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.update!(threading_enabled: true)channel_1.add(current_user)diff --git a/plugins/chat/spec/system/reply_to_message/smoke_spec.rb b/plugins/chat/spec/system/reply_to_message/smoke_spec.rbindex 505f94be5a0..0fdb543ac92 100644--- a/plugins/chat/spec/system/reply_to_message/smoke_spec.rb+++ b/plugins/chat/spec/system/reply_to_message/smoke_spec.rb@@ -11,7 +11,6 @@ RSpec.describe "Reply to message - smoke", type: :system dofab!(:original_message) { Fabricate(:chat_message, chat_channel: channel_1) }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.add(user_1)channel_1.add(user_2)diff --git a/plugins/chat/spec/system/select_message/thread_spec.rb b/plugins/chat/spec/system/select_message/thread_spec.rbindex 31f086299ef..3f6f0b486ac 100644--- a/plugins/chat/spec/system/select_message/thread_spec.rb+++ b/plugins/chat/spec/system/select_message/thread_spec.rb@@ -10,7 +10,6 @@ RSpec.describe "Chat | Select message | thread", type: :system dolet(:thread_page) { PageObjects::Pages::ChatThread.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrapchannel_1.add(current_user)sign_in(current_user)@@ -26,10 +25,7 @@ RSpec.describe "Chat | Select message | thread", type: :system doFabricate(:chat_message, chat_channel: channel_1, in_reply_to: original_message)end- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel_1.update!(threading_enabled: true)- end+ before { channel_1.update!(threading_enabled: true) }it "can select multiple messages" dochat_page.visit_thread(thread_message_1.thread)diff --git a/plugins/chat/spec/system/single_thread_spec.rb b/plugins/chat/spec/system/single_thread_spec.rbindex 9553dea9113..d9cb64a861a 100644--- a/plugins/chat/spec/system/single_thread_spec.rb+++ b/plugins/chat/spec/system/single_thread_spec.rb@@ -15,25 +15,9 @@ describe "Single thread in side panel", type: :system dosign_in(current_user)end- context "when enable_experimental_chat_threaded_discussions is disabled" do- fab!(:channel) { Fabricate(:chat_channel) }- before { SiteSetting.enable_experimental_chat_threaded_discussions = false }-- it "does not open the side panel for a single thread" do- thread =- chat_thread_chain_bootstrap(channel: channel, users: [current_user, Fabricate(:user)])- chat_page.visit_channel(channel)- channel_page.hover_message(thread.original_message)- expect(page).not_to have_css(".chat-message-thread-btn")- end- end-context "when threading_enabled is false for the channel" dofab!(:channel) { Fabricate(:chat_channel) }- before do- SiteSetting.enable_experimental_chat_threaded_discussions = true- channel.update!(threading_enabled: false)- end+ before { channel.update!(threading_enabled: false) }it "does not open the side panel for a single thread" dothread =@@ -44,13 +28,11 @@ describe "Single thread in side panel", type: :system doendend- context "when enable_experimental_chat_threaded_discussions is true and threading is enabled for the channel" do+ context "when threading is enabled for the channel" dofab!(:user_2) { Fabricate(:user) }fab!(:channel) { Fabricate(:chat_channel, threading_enabled: true) }fab!(:thread) { chat_thread_chain_bootstrap(channel: channel, users: [current_user, user_2]) }- before { SiteSetting.enable_experimental_chat_threaded_discussions = true }-context "when in full page" docontext "when switching channel" dofab!(:channel_2) { Fabricate(:chat_channel, threading_enabled: true) }diff --git a/plugins/chat/spec/system/thread_list/drawer_spec.rb b/plugins/chat/spec/system/thread_list/drawer_spec.rbindex c3b44920506..315d84186c0 100644--- a/plugins/chat/spec/system/thread_list/drawer_spec.rb+++ b/plugins/chat/spec/system/thread_list/drawer_spec.rb@@ -13,7 +13,6 @@ describe "Thread list in side panel | drawer", type: :system dolet(:drawer_page) { PageObjects::Pages::ChatDrawer.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrap(current_user, [channel])sign_in(current_user)enddiff --git a/plugins/chat/spec/system/thread_list/full_page_spec.rb b/plugins/chat/spec/system/thread_list/full_page_spec.rbindex a9dc724c280..dfc69386a5c 100644--- a/plugins/chat/spec/system/thread_list/full_page_spec.rb+++ b/plugins/chat/spec/system/thread_list/full_page_spec.rb@@ -13,7 +13,6 @@ describe "Thread list in side panel | full page", type: :system dolet(:thread_list_page) { PageObjects::Components::Chat::ThreadList.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrap(current_user, [channel])sign_in(current_user)enddiff --git a/plugins/chat/spec/system/thread_tracking/drawer_spec.rb b/plugins/chat/spec/system/thread_tracking/drawer_spec.rbindex 11345dfa8a8..8f6c5c91c97 100644--- a/plugins/chat/spec/system/thread_tracking/drawer_spec.rb+++ b/plugins/chat/spec/system/thread_tracking/drawer_spec.rb@@ -15,7 +15,6 @@ describe "Thread tracking state | drawer", type: :system dolet(:drawer_page) { PageObjects::Pages::ChatDrawer.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrap(current_user, [channel])chat_system_user_bootstrap(user: other_user, channel: channel)sign_in(current_user)diff --git a/plugins/chat/spec/system/thread_tracking/full_page_spec.rb b/plugins/chat/spec/system/thread_tracking/full_page_spec.rbindex 0a041c6aa2c..9f284d4a336 100644--- a/plugins/chat/spec/system/thread_tracking/full_page_spec.rb+++ b/plugins/chat/spec/system/thread_tracking/full_page_spec.rb@@ -13,7 +13,6 @@ describe "Thread tracking state | full page", type: :system dolet(:sidebar_page) { PageObjects::Pages::Sidebar.new }before do- SiteSetting.enable_experimental_chat_threaded_discussions = truechat_system_bootstrap(current_user, [channel])sign_in(current_user)thread.add(current_user)