From ae16f51aea1dd4b27f01e6bd94d5d79d0e57ed84 Mon Sep 17 00:00:00 2001 From: Ashish Bhate Date: Tue, 1 Feb 2022 16:21:04 +0530 Subject: [PATCH] [MM-41351] Set ThreadAutoFollow to false by default (#19441) Summary ThreadAutoFollow is now false by default. Won't affect existing systems that have it set to true. Ticket Link https://mattermost.atlassian.net/browse/MM-41351 --- api4/user_test.go | 5 +++++ app/post_test.go | 4 ++++ model/config.go | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api4/user_test.go b/api4/user_test.go index 456b93efc0..d02196dda0 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -5947,6 +5947,11 @@ func TestFollowThreads(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() + th.App.UpdateConfig(func(cfg *model.Config) { + *cfg.ServiceSettings.ThreadAutoFollow = true + *cfg.ServiceSettings.CollapsedThreads = model.CollapsedThreadsDefaultOn + }) + t.Run("1 thread", func(t *testing.T) { client := th.Client diff --git a/app/post_test.go b/app/post_test.go index 896b4a25d4..29d55f10e1 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -2100,6 +2100,10 @@ func TestThreadMembership(t *testing.T) { t.Run("should update memberships for conversation participants", func(t *testing.T) { th := Setup(t).InitBasic() defer th.TearDown() + th.App.UpdateConfig(func(cfg *model.Config) { + *cfg.ServiceSettings.ThreadAutoFollow = true + *cfg.ServiceSettings.CollapsedThreads = model.CollapsedThreadsDefaultOn + }) user1 := th.BasicUser user2 := th.BasicUser2 diff --git a/model/config.go b/model/config.go index 22efd28997..d70b06b5b8 100644 --- a/model/config.go +++ b/model/config.go @@ -772,7 +772,7 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) { } if s.ThreadAutoFollow == nil { - s.ThreadAutoFollow = NewBool(true) + s.ThreadAutoFollow = NewBool(false) } if s.CollapsedThreads == nil {