From 72fcedd23a33be7935377f3f3a186a41abf954e7 Mon Sep 17 00:00:00 2001 From: Maria A Nunez Date: Tue, 21 May 2024 13:41:31 -0400 Subject: [PATCH] Lower user limit soft warning to 5K (#27034) Automatic Merge --- server/channels/app/limits.go | 2 +- server/channels/app/limits_test.go | 2 +- .../src/components/common/accordion/accordion_card.tsx | 2 +- .../src/packages/mattermost-redux/src/actions/limits.test.ts | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/channels/app/limits.go b/server/channels/app/limits.go index 71032d4beb..ff216fd74c 100644 --- a/server/channels/app/limits.go +++ b/server/channels/app/limits.go @@ -12,7 +12,7 @@ import ( ) const ( - maxUsersLimit = 10_000 + maxUsersLimit = 5_000 maxUsersHardLimit = 11_000 ) diff --git a/server/channels/app/limits_test.go b/server/channels/app/limits_test.go index c3efa081fd..852a69b915 100644 --- a/server/channels/app/limits_test.go +++ b/server/channels/app/limits_test.go @@ -20,7 +20,7 @@ func TestGetServerLimits(t *testing.T) { // InitBasic creates 3 users by default require.Equal(t, int64(3), serverLimits.ActiveUserCount) - require.Equal(t, int64(10000), serverLimits.MaxUsersLimit) + require.Equal(t, int64(5000), serverLimits.MaxUsersLimit) }) t.Run("user count should increase on creating new user and decrease on permanently deleting", func(t *testing.T) { diff --git a/webapp/channels/src/components/common/accordion/accordion_card.tsx b/webapp/channels/src/components/common/accordion/accordion_card.tsx index 0de9cba1e7..c804b91cb7 100644 --- a/webapp/channels/src/components/common/accordion/accordion_card.tsx +++ b/webapp/channels/src/components/common/accordion/accordion_card.tsx @@ -49,7 +49,7 @@ const AccordionCard = ({ setHeight(0); } setOpen(isExpanded); - }, [isExpanded]); + }, [data.items.length, isExpanded]); const hasItems = data.items.length > 0; diff --git a/webapp/channels/src/packages/mattermost-redux/src/actions/limits.test.ts b/webapp/channels/src/packages/mattermost-redux/src/actions/limits.test.ts index 80d392b10a..dff50bbeea 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/actions/limits.test.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/actions/limits.test.ts @@ -76,7 +76,8 @@ describe('getServerLimits', () => { test('should return data if user is admin', async () => { const userLimits: ServerLimits = { activeUserCount: 600, - maxUsersLimit: 10_000, + maxUsersLimit: 5_000, + }; nock(Client4.getBaseRoute()).