From d23c16b9aa6061926c9ec6a962d5156e424d21f7 Mon Sep 17 00:00:00 2001 From: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com> Date: Mon, 25 Dec 2023 12:41:28 +0530 Subject: [PATCH] Removed user bands (#25806) --- api/v4/source/definitions.yaml | 8 -------- server/channels/app/limits.go | 12 +++--------- server/channels/app/limits_test.go | 4 ---- server/public/model/limits.go | 6 ++---- 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/api/v4/source/definitions.yaml b/api/v4/source/definitions.yaml index 798865264e..fbbe43ceb9 100644 --- a/api/v4/source/definitions.yaml +++ b/api/v4/source/definitions.yaml @@ -3576,14 +3576,6 @@ components: description: The maximum number of users allowed on server type: integer format: int64 - lowerBandUserLimit: - description: User count after which to show the first upgrade message - type: integer - format: int64 - upperBandUserLimit: - description: User count after which to show the second upgrade message - type: integer - format: int64 activeUserCount: description: The number of active users in the server type: integer diff --git a/server/channels/app/limits.go b/server/channels/app/limits.go index ecf613f1dd..09eb7d54d0 100644 --- a/server/channels/app/limits.go +++ b/server/channels/app/limits.go @@ -9,11 +9,7 @@ import ( "github.com/mattermost/mattermost/server/public/model" ) -const ( - lowerBandUsersLimit = 500 - upperBandUsersLimit = 9000 - maxUsersLimit = 10000 -) +const maxUsersLimit = 10000 func (a *App) GetUserLimits() (*model.UserLimits, *model.AppError) { if !a.shouldShowUserLimits() { @@ -26,10 +22,8 @@ func (a *App) GetUserLimits() (*model.UserLimits, *model.AppError) { } return &model.UserLimits{ - ActiveUserCount: activeUserCount, - LowerBandUserLimit: lowerBandUsersLimit, - UpperBandUserLimit: upperBandUsersLimit, - MaxUsersLimit: maxUsersLimit, + ActiveUserCount: activeUserCount, + MaxUsersLimit: maxUsersLimit, }, nil } diff --git a/server/channels/app/limits_test.go b/server/channels/app/limits_test.go index bbb39a6421..fb74310487 100644 --- a/server/channels/app/limits_test.go +++ b/server/channels/app/limits_test.go @@ -21,8 +21,6 @@ func TestGetUserLimits(t *testing.T) { // InitBasic creates 3 users by default require.Equal(t, int64(3), userLimits.ActiveUserCount) require.Equal(t, int64(10000), userLimits.MaxUsersLimit) - require.Equal(t, int64(500), userLimits.LowerBandUserLimit) - require.Equal(t, int64(9000), userLimits.UpperBandUserLimit) }) t.Run("user count should increase on creating new user and decrease on permanently deleting", func(t *testing.T) { @@ -130,7 +128,5 @@ func TestGetUserLimits(t *testing.T) { require.Equal(t, int64(0), userLimits.ActiveUserCount) require.Equal(t, int64(0), userLimits.MaxUsersLimit) - require.Equal(t, int64(0), userLimits.LowerBandUserLimit) - require.Equal(t, int64(0), userLimits.UpperBandUserLimit) }) } diff --git a/server/public/model/limits.go b/server/public/model/limits.go index 083d8bce0a..b8d55c2a4e 100644 --- a/server/public/model/limits.go +++ b/server/public/model/limits.go @@ -4,8 +4,6 @@ package model type UserLimits struct { - MaxUsersLimit int64 `json:"maxUsersLimit"` // max number of users allowed - LowerBandUserLimit int64 `json:"lowerBandUserLimit"` // user count for 1st warning - UpperBandUserLimit int64 `json:"upperBandUserLimit"` // user count for 2nd warning - ActiveUserCount int64 `json:"activeUserCount"` // actual number of active users on server. Active = non deleted + MaxUsersLimit int64 `json:"maxUsersLimit"` // max number of users allowed + ActiveUserCount int64 `json:"activeUserCount"` // actual number of active users on server. Active = non deleted }