summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-08-08 12:04:36 +0200
committerCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-08-08 12:04:36 +0200
commit6bf09e2c34c568e3cb0d296142d5abed77332635 (patch)
treea8a05b94c842d53dede08fe8d52ad28cf2c89a73
parent3b640cd51b5b622002d6c9a0d6b1e7a6e9dafb69 (diff)
downloadchat-6bf09e2c34c568e3cb0d296142d5abed77332635.tar.gz
chat-6bf09e2c34c568e3cb0d296142d5abed77332635.tar.bz2
chat-6bf09e2c34c568e3cb0d296142d5abed77332635.zip
MM-11384: Add system install date information to the client config (#9218)
* MM-11384: Add system install date information to the client config * Fixing translation text * Fixes from Peer Review
-rw-r--r--app/app.go18
-rw-r--r--app/config.go29
-rw-r--r--app/config_test.go81
-rw-r--r--i18n/en.json8
-rw-r--r--model/system.go1
-rw-r--r--store/sqlstore/user_store.go11
-rw-r--r--store/store.go1
-rw-r--r--store/storetest/mocks/AuditStore.go2
-rw-r--r--store/storetest/mocks/ChannelMemberHistoryStore.go2
-rw-r--r--store/storetest/mocks/ChannelStore.go18
-rw-r--r--store/storetest/mocks/ClusterDiscoveryStore.go2
-rw-r--r--store/storetest/mocks/CommandStore.go2
-rw-r--r--store/storetest/mocks/CommandWebhookStore.go2
-rw-r--r--store/storetest/mocks/ComplianceStore.go2
-rw-r--r--store/storetest/mocks/EmojiStore.go2
-rw-r--r--store/storetest/mocks/FileInfoStore.go2
-rw-r--r--store/storetest/mocks/JobStore.go2
-rw-r--r--store/storetest/mocks/LayeredStoreDatabaseLayer.go2
-rw-r--r--store/storetest/mocks/LayeredStoreSupplier.go2
-rw-r--r--store/storetest/mocks/LicenseStore.go2
-rw-r--r--store/storetest/mocks/OAuthStore.go2
-rw-r--r--store/storetest/mocks/PluginStore.go2
-rw-r--r--store/storetest/mocks/PostStore.go2
-rw-r--r--store/storetest/mocks/PreferenceStore.go2
-rw-r--r--store/storetest/mocks/ReactionStore.go2
-rw-r--r--store/storetest/mocks/RoleStore.go2
-rw-r--r--store/storetest/mocks/SchemeStore.go2
-rw-r--r--store/storetest/mocks/SessionStore.go2
-rw-r--r--store/storetest/mocks/SqlStore.go2
-rw-r--r--store/storetest/mocks/StatusStore.go2
-rw-r--r--store/storetest/mocks/Store.go2
-rw-r--r--store/storetest/mocks/SystemStore.go2
-rw-r--r--store/storetest/mocks/TeamStore.go2
-rw-r--r--store/storetest/mocks/TokenStore.go2
-rw-r--r--store/storetest/mocks/UserAccessTokenStore.go2
-rw-r--r--store/storetest/mocks/UserStore.go18
-rw-r--r--store/storetest/mocks/WebhookStore.go2
37 files changed, 203 insertions, 38 deletions
diff --git a/app/app.go b/app/app.go
index 5cedca2ad..b704bb449 100644
--- a/app/app.go
+++ b/app/app.go
@@ -11,6 +11,7 @@ import (
"net/http"
"path"
"reflect"
+ "strconv"
"strings"
"sync"
"sync/atomic"
@@ -212,6 +213,10 @@ func New(options ...Option) (outApp *App, outErr error) {
return nil, errors.Wrapf(err, "unable to ensure asymmetric signing key")
}
+ if err := app.ensureInstallationDate(); err != nil {
+ return nil, errors.Wrapf(err, "unable to ensure installation date")
+ }
+
app.EnsureDiagnosticId()
app.regenerateClientConfig()
@@ -740,3 +745,16 @@ func (a *App) StartElasticsearch() {
}
})
}
+
+func (a *App) getSystemInstallDate() (int64, *model.AppError) {
+ result := <-a.Srv.Store.System().GetByName(model.SYSTEM_INSTALLATION_DATE_KEY)
+ if result.Err != nil {
+ return 0, result.Err
+ }
+ systemData := result.Data.(*model.System)
+ value, err := strconv.ParseInt(systemData.Value, 10, 64)
+ if err != nil {
+ return 0, model.NewAppError("getSystemInstallDate", "app.system_install_date.parse_int.app_error", nil, err.Error(), http.StatusInternalServerError)
+ }
+ return value, nil
+}
diff --git a/app/config.go b/app/config.go
index 21571f291..1e96fd4fa 100644
--- a/app/config.go
+++ b/app/config.go
@@ -16,6 +16,7 @@ import (
"runtime/debug"
"strconv"
"strings"
+ "time"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
@@ -208,6 +209,30 @@ func (a *App) ensureAsymmetricSigningKey() error {
return nil
}
+func (a *App) ensureInstallationDate() error {
+ _, err := a.getSystemInstallDate()
+ if err == nil {
+ return nil
+ }
+
+ result := <-a.Srv.Store.User().InferSystemInstallDate()
+ var installationDate int64
+ if result.Err == nil && result.Data.(int64) > 0 {
+ installationDate = result.Data.(int64)
+ } else {
+ installationDate = utils.MillisFromTime(time.Now())
+ }
+
+ result = <-a.Srv.Store.System().SaveOrUpdate(&model.System{
+ Name: model.SYSTEM_INSTALLATION_DATE_KEY,
+ Value: strconv.FormatInt(installationDate, 10),
+ })
+ if result.Err != nil {
+ return result.Err
+ }
+ return nil
+}
+
// AsymmetricSigningKey will return a private key that can be used for asymmetric signing.
func (a *App) AsymmetricSigningKey() *ecdsa.PrivateKey {
return a.asymmetricSigningKey
@@ -296,6 +321,10 @@ func (a *App) ClientConfigWithComputed() map[string]string {
// by the client.
respCfg["NoAccounts"] = strconv.FormatBool(a.IsFirstUserAccount())
respCfg["MaxPostSize"] = strconv.Itoa(a.MaxPostSize())
+ respCfg["InstallationDate"] = ""
+ if installationDate, err := a.getSystemInstallDate(); err == nil {
+ respCfg["InstallationDate"] = strconv.FormatInt(installationDate, 10)
+ }
return respCfg
}
diff --git a/app/config_test.go b/app/config_test.go
index 4fc7df5e2..eb3fa8a53 100644
--- a/app/config_test.go
+++ b/app/config_test.go
@@ -4,11 +4,15 @@
package app
import (
+ "strconv"
"testing"
+ "time"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/model"
+ "github.com/mattermost/mattermost-server/store/sqlstore"
+ "github.com/mattermost/mattermost-server/utils"
)
func TestConfigListener(t *testing.T) {
@@ -76,3 +80,80 @@ func TestClientConfigWithComputed(t *testing.T) {
t.Fatal("expected MaxPostSize in returned config")
}
}
+
+func TestEnsureInstallationDate(t *testing.T) {
+ th := Setup()
+ defer th.TearDown()
+
+ tt := []struct {
+ Name string
+ PrevInstallationDate *int64
+ UsersCreationDates []int64
+ ExpectedInstallationDate *int64
+ }{
+ {
+ Name: "New installation: no users, no installation date",
+ PrevInstallationDate: nil,
+ UsersCreationDates: nil,
+ ExpectedInstallationDate: model.NewInt64(utils.MillisFromTime(time.Now())),
+ },
+ {
+ Name: "Old installation: users, no installation date",
+ PrevInstallationDate: nil,
+ UsersCreationDates: []int64{10000000000, 30000000000, 20000000000},
+ ExpectedInstallationDate: model.NewInt64(10000000000),
+ },
+ {
+ Name: "New installation, second run: no users, installation date",
+ PrevInstallationDate: model.NewInt64(80000000000),
+ UsersCreationDates: []int64{10000000000, 30000000000, 20000000000},
+ ExpectedInstallationDate: model.NewInt64(80000000000),
+ },
+ {
+ Name: "Old installation already updated: users, installation date",
+ PrevInstallationDate: model.NewInt64(90000000000),
+ UsersCreationDates: []int64{10000000000, 30000000000, 20000000000},
+ ExpectedInstallationDate: model.NewInt64(90000000000),
+ },
+ }
+
+ for _, tc := range tt {
+ t.Run(tc.Name, func(t *testing.T) {
+ sqlStore := th.App.Srv.Store.User().(*sqlstore.SqlUserStore)
+ sqlStore.GetMaster().Exec("DELETE FROM Users")
+
+ var users []*model.User
+ for _, createAt := range tc.UsersCreationDates {
+ user := th.CreateUser()
+ user.CreateAt = createAt
+ sqlStore.GetMaster().Exec("UPDATE Users SET CreateAt = :CreateAt WHERE Id = :UserId", map[string]interface{}{"CreateAt": createAt, "UserId": user.Id})
+ users = append(users, user)
+ }
+
+ if tc.PrevInstallationDate == nil {
+ <-th.App.Srv.Store.System().PermanentDeleteByName(model.SYSTEM_INSTALLATION_DATE_KEY)
+ } else {
+ <-th.App.Srv.Store.System().SaveOrUpdate(&model.System{
+ Name: model.SYSTEM_INSTALLATION_DATE_KEY,
+ Value: strconv.FormatInt(*tc.PrevInstallationDate, 10),
+ })
+ }
+
+ err := th.App.ensureInstallationDate()
+
+ if tc.ExpectedInstallationDate == nil {
+ assert.Error(t, err)
+ } else {
+ assert.NoError(t, err)
+
+ result := <-th.App.Srv.Store.System().GetByName(model.SYSTEM_INSTALLATION_DATE_KEY)
+ assert.Nil(t, result.Err)
+ data, _ := result.Data.(*model.System)
+ value, _ := strconv.ParseInt(data.Value, 10, 64)
+ assert.True(t, *tc.ExpectedInstallationDate <= value && *tc.ExpectedInstallationDate+1000 >= value)
+ }
+
+ sqlStore.GetMaster().Exec("DELETE FROM Users")
+ })
+ }
+}
diff --git a/i18n/en.json b/i18n/en.json
index 3c2cee632..d3ffdebb5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -3111,6 +3111,10 @@
"translation": "This API endpoint is not accessible as required migrations have not yet completed."
},
{
+ "id": "app.system_install_date.parse_int.app_error",
+ "translation": "Failed to parse installation date"
+ },
+ {
"id": "app.team.join_user_to_team.max_accounts.app_error",
"translation": "This team has reached the maximum number of allowed accounts. Contact your systems administrator to set a higher limit."
},
@@ -5939,6 +5943,10 @@
"translation": "We found multiple users matching your credentials and were unable to log you in. Please contact an administrator."
},
{
+ "id": "store.sql_user.get_system_install_date.app_error",
+ "translation": "Unable to infer the system date based on the first user creation date."
+ },
+ {
"id": "store.sql_user.get_new_users.app_error",
"translation": "We encountered an error while finding the new users"
},
diff --git a/model/system.go b/model/system.go
index 2a636b14f..4228516d5 100644
--- a/model/system.go
+++ b/model/system.go
@@ -16,6 +16,7 @@ const (
SYSTEM_ACTIVE_LICENSE_ID = "ActiveLicenseId"
SYSTEM_LAST_COMPLIANCE_TIME = "LastComplianceTime"
SYSTEM_ASYMMETRIC_SIGNING_KEY = "AsymmetricSigningKey"
+ SYSTEM_INSTALLATION_DATE_KEY = "InstallationDate"
)
type System struct {
diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go
index 203ad4c26..d8a77cd9d 100644
--- a/store/sqlstore/user_store.go
+++ b/store/sqlstore/user_store.go
@@ -1316,3 +1316,14 @@ func (us SqlUserStore) ClearAllCustomRoleAssignments() store.StoreChannel {
}
})
}
+
+func (us SqlUserStore) InferSystemInstallDate() store.StoreChannel {
+ return store.Do(func(result *store.StoreResult) {
+ createAt, err := us.GetReplica().SelectInt("SELECT CreateAt FROM Users WHERE CreateAt IS NOT NULL ORDER BY CreateAt ASC LIMIT 1")
+ if err != nil {
+ result.Err = model.NewAppError("SqlUserStore.GetSystemInstallDate", "store.sql_user.get_system_install_date.app_error", nil, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ result.Data = createAt
+ })
+}
diff --git a/store/store.go b/store/store.go
index 2f18a0d8f..89adce188 100644
--- a/store/store.go
+++ b/store/store.go
@@ -263,6 +263,7 @@ type UserStore interface {
GetProfilesNotInTeam(teamId string, offset int, limit int) StoreChannel
GetEtagForProfilesNotInTeam(teamId string) StoreChannel
ClearAllCustomRoleAssignments() StoreChannel
+ InferSystemInstallDate() StoreChannel
}
type SessionStore interface {
diff --git a/store/storetest/mocks/AuditStore.go b/store/storetest/mocks/AuditStore.go
index df84545bd..d1ee9082e 100644
--- a/store/storetest/mocks/AuditStore.go
+++ b/store/storetest/mocks/AuditStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/ChannelMemberHistoryStore.go b/store/storetest/mocks/ChannelMemberHistoryStore.go
index 16155b982..ae8d024d1 100644
--- a/store/storetest/mocks/ChannelMemberHistoryStore.go
+++ b/store/storetest/mocks/ChannelMemberHistoryStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/ChannelStore.go b/store/storetest/mocks/ChannelStore.go
index 4cbf9cb77..8adc98e10 100644
--- a/store/storetest/mocks/ChannelStore.go
+++ b/store/storetest/mocks/ChannelStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
@@ -45,9 +45,9 @@ func (_m *ChannelStore) AnalyticsTypeCount(teamId string, channelType string) st
return r0
}
-// AutocompleteInTeam provides a mock function with given fields: teamId, term
+// AutocompleteInTeam provides a mock function with given fields: teamId, term, includeDeleted
func (_m *ChannelStore) AutocompleteInTeam(teamId string, term string, includeDeleted bool) store.StoreChannel {
- ret := _m.Called(teamId, term)
+ ret := _m.Called(teamId, term, includeDeleted)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string, string, bool) store.StoreChannel); ok {
@@ -146,9 +146,9 @@ func (_m *ChannelStore) GetAll(teamId string) store.StoreChannel {
return r0
}
-// GetAllChannelMembersForUser provides a mock function with given fields: userId, allowFromCache
+// GetAllChannelMembersForUser provides a mock function with given fields: userId, allowFromCache, includeDeleted
func (_m *ChannelStore) GetAllChannelMembersForUser(userId string, allowFromCache bool, includeDeleted bool) store.StoreChannel {
- ret := _m.Called(userId, allowFromCache)
+ ret := _m.Called(userId, allowFromCache, includeDeleted)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string, bool, bool) store.StoreChannel); ok {
@@ -258,9 +258,9 @@ func (_m *ChannelStore) GetChannelUnread(channelId string, userId string) store.
return r0
}
-// GetChannels provides a mock function with given fields: teamId, userId
+// GetChannels provides a mock function with given fields: teamId, userId, includeDeleted
func (_m *ChannelStore) GetChannels(teamId string, userId string, includeDeleted bool) store.StoreChannel {
- ret := _m.Called(teamId, userId)
+ ret := _m.Called(teamId, userId, includeDeleted)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string, string, bool) store.StoreChannel); ok {
@@ -775,9 +775,9 @@ func (_m *ChannelStore) SaveMember(member *model.ChannelMember) store.StoreChann
return r0
}
-// SearchInTeam provides a mock function with given fields: teamId, term
+// SearchInTeam provides a mock function with given fields: teamId, term, includeDeleted
func (_m *ChannelStore) SearchInTeam(teamId string, term string, includeDeleted bool) store.StoreChannel {
- ret := _m.Called(teamId, term)
+ ret := _m.Called(teamId, term, includeDeleted)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string, string, bool) store.StoreChannel); ok {
diff --git a/store/storetest/mocks/ClusterDiscoveryStore.go b/store/storetest/mocks/ClusterDiscoveryStore.go
index 997dcf03f..4010006d8 100644
--- a/store/storetest/mocks/ClusterDiscoveryStore.go
+++ b/store/storetest/mocks/ClusterDiscoveryStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/CommandStore.go b/store/storetest/mocks/CommandStore.go
index de4bc4e34..798bbee4d 100644
--- a/store/storetest/mocks/CommandStore.go
+++ b/store/storetest/mocks/CommandStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/CommandWebhookStore.go b/store/storetest/mocks/CommandWebhookStore.go
index cede8cdd2..5129388ae 100644
--- a/store/storetest/mocks/CommandWebhookStore.go
+++ b/store/storetest/mocks/CommandWebhookStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/ComplianceStore.go b/store/storetest/mocks/ComplianceStore.go
index fb828cd4b..dd75941b3 100644
--- a/store/storetest/mocks/ComplianceStore.go
+++ b/store/storetest/mocks/ComplianceStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/EmojiStore.go b/store/storetest/mocks/EmojiStore.go
index 9871c98aa..b1f0a3217 100644
--- a/store/storetest/mocks/EmojiStore.go
+++ b/store/storetest/mocks/EmojiStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/FileInfoStore.go b/store/storetest/mocks/FileInfoStore.go
index a33ca0453..fa8ee444f 100644
--- a/store/storetest/mocks/FileInfoStore.go
+++ b/store/storetest/mocks/FileInfoStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/JobStore.go b/store/storetest/mocks/JobStore.go
index d3558212e..a78a3f94e 100644
--- a/store/storetest/mocks/JobStore.go
+++ b/store/storetest/mocks/JobStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/LayeredStoreDatabaseLayer.go b/store/storetest/mocks/LayeredStoreDatabaseLayer.go
index 47b594a81..8e82e9494 100644
--- a/store/storetest/mocks/LayeredStoreDatabaseLayer.go
+++ b/store/storetest/mocks/LayeredStoreDatabaseLayer.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/LayeredStoreSupplier.go b/store/storetest/mocks/LayeredStoreSupplier.go
index 929f077c7..ddd0abf58 100644
--- a/store/storetest/mocks/LayeredStoreSupplier.go
+++ b/store/storetest/mocks/LayeredStoreSupplier.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/LicenseStore.go b/store/storetest/mocks/LicenseStore.go
index 5c65425ea..f00ebba78 100644
--- a/store/storetest/mocks/LicenseStore.go
+++ b/store/storetest/mocks/LicenseStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/OAuthStore.go b/store/storetest/mocks/OAuthStore.go
index fb49d715d..a39570b6c 100644
--- a/store/storetest/mocks/OAuthStore.go
+++ b/store/storetest/mocks/OAuthStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/PluginStore.go b/store/storetest/mocks/PluginStore.go
index 920b0f63c..b6f161a86 100644
--- a/store/storetest/mocks/PluginStore.go
+++ b/store/storetest/mocks/PluginStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/PostStore.go b/store/storetest/mocks/PostStore.go
index f97b8a2f6..1c1baec7b 100644
--- a/store/storetest/mocks/PostStore.go
+++ b/store/storetest/mocks/PostStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/PreferenceStore.go b/store/storetest/mocks/PreferenceStore.go
index 5ad56914a..f53ae06d5 100644
--- a/store/storetest/mocks/PreferenceStore.go
+++ b/store/storetest/mocks/PreferenceStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/ReactionStore.go b/store/storetest/mocks/ReactionStore.go
index ce09f3f76..b3e81a83b 100644
--- a/store/storetest/mocks/ReactionStore.go
+++ b/store/storetest/mocks/ReactionStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/RoleStore.go b/store/storetest/mocks/RoleStore.go
index c1b14d5dc..95e1914e0 100644
--- a/store/storetest/mocks/RoleStore.go
+++ b/store/storetest/mocks/RoleStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/SchemeStore.go b/store/storetest/mocks/SchemeStore.go
index ddf24c2c3..d54e73261 100644
--- a/store/storetest/mocks/SchemeStore.go
+++ b/store/storetest/mocks/SchemeStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/SessionStore.go b/store/storetest/mocks/SessionStore.go
index 70b2bd945..819ae948d 100644
--- a/store/storetest/mocks/SessionStore.go
+++ b/store/storetest/mocks/SessionStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/SqlStore.go b/store/storetest/mocks/SqlStore.go
index a0cc3f0cc..a93db78c9 100644
--- a/store/storetest/mocks/SqlStore.go
+++ b/store/storetest/mocks/SqlStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/StatusStore.go b/store/storetest/mocks/StatusStore.go
index 4acb90bdd..68ccdd4ec 100644
--- a/store/storetest/mocks/StatusStore.go
+++ b/store/storetest/mocks/StatusStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/Store.go b/store/storetest/mocks/Store.go
index 3a5b7726c..e5d0c4290 100644
--- a/store/storetest/mocks/Store.go
+++ b/store/storetest/mocks/Store.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/SystemStore.go b/store/storetest/mocks/SystemStore.go
index b31e4646d..e36396fe1 100644
--- a/store/storetest/mocks/SystemStore.go
+++ b/store/storetest/mocks/SystemStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/TeamStore.go b/store/storetest/mocks/TeamStore.go
index 47ea6587b..db5cb658f 100644
--- a/store/storetest/mocks/TeamStore.go
+++ b/store/storetest/mocks/TeamStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/TokenStore.go b/store/storetest/mocks/TokenStore.go
index b4baacf03..657aeca49 100644
--- a/store/storetest/mocks/TokenStore.go
+++ b/store/storetest/mocks/TokenStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/UserAccessTokenStore.go b/store/storetest/mocks/UserAccessTokenStore.go
index c5ef0fefe..fd98a8a99 100644
--- a/store/storetest/mocks/UserAccessTokenStore.go
+++ b/store/storetest/mocks/UserAccessTokenStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
diff --git a/store/storetest/mocks/UserStore.go b/store/storetest/mocks/UserStore.go
index 760b6e934..1f9f07e7d 100644
--- a/store/storetest/mocks/UserStore.go
+++ b/store/storetest/mocks/UserStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
@@ -514,6 +514,22 @@ func (_m *UserStore) GetUnreadCountForChannel(userId string, channelId string) s
return r0
}
+// InferSystemInstallDate provides a mock function with given fields:
+func (_m *UserStore) InferSystemInstallDate() store.StoreChannel {
+ ret := _m.Called()
+
+ var r0 store.StoreChannel
+ if rf, ok := ret.Get(0).(func() store.StoreChannel); ok {
+ r0 = rf()
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(store.StoreChannel)
+ }
+ }
+
+ return r0
+}
+
// InvalidatProfileCacheForUser provides a mock function with given fields: userId
func (_m *UserStore) InvalidatProfileCacheForUser(userId string) {
_m.Called(userId)
diff --git a/store/storetest/mocks/WebhookStore.go b/store/storetest/mocks/WebhookStore.go
index bf5b636eb..a0b2b0bee 100644
--- a/store/storetest/mocks/WebhookStore.go
+++ b/store/storetest/mocks/WebhookStore.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v1.0.0
+// Code generated by mockery v1.0.0. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.