* Migration completed

* Fix tests

* Fix tests

* Fix tests

* Suggestions

* Trigger CI

* Suggestions

* Merge with master

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
Rodrigo Villablanca
2020-10-26 06:41:27 -03:00
коммит произвёл GitHub
родитель d51d843fcd
Коммит 96f1739f8f
55 изменённых файлов: 2487 добавлений и 1568 удалений

Просмотреть файл

@@ -6,9 +6,6 @@ package store
const (
CHANNEL_EXISTS_ERROR = "store.sql_channel.save_channel.exists.app_error"
MISSING_ACCOUNT_ERROR = "store.sql_user.missing_account.const"
MISSING_AUTH_ACCOUNT_ERROR = "store.sql_user.get_by_auth.missing_account.app_error"
USER_SEARCH_OPTION_NAMES_ONLY = "names_only"
USER_SEARCH_OPTION_NAMES_ONLY_NO_FULL_NAME = "names_only_no_full_name"
USER_SEARCH_OPTION_ALL_NO_FULL_NAME = "all_no_full_name"

Просмотреть файл

@@ -71,7 +71,7 @@ func (s LocalCacheUserStore) InvalidateProfilesInChannelCache(channelId string)
}
}
func (s LocalCacheUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, *model.AppError) {
func (s LocalCacheUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, error) {
if allowFromCache {
var cachedMap map[string]*model.User
if err := s.rootStore.doStandardReadCache(s.rootStore.profilesInChannelCache, channelId, &cachedMap); err == nil {
@@ -91,7 +91,7 @@ func (s LocalCacheUserStore) GetAllProfilesInChannel(channelId string, allowFrom
return userMap, nil
}
func (s LocalCacheUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
func (s LocalCacheUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, error) {
if !allowFromCache {
return s.UserStore.GetProfileByIds(userIds, options, false)
}
@@ -137,7 +137,7 @@ func (s LocalCacheUserStore) GetProfileByIds(userIds []string, options *store.Us
// It checks if the user entry is present in the cache, returning the entry from cache
// if it is present. Otherwise, it fetches the entry from the store and stores it in the
// cache.
func (s LocalCacheUserStore) Get(id string) (*model.User, *model.AppError) {
func (s LocalCacheUserStore) Get(id string) (*model.User, error) {
var cacheItem *model.User
if err := s.rootStore.doStandardReadCache(s.rootStore.userProfileByIdsCache, id, &cacheItem); err == nil {
if s.rootStore.metrics != nil {

Просмотреть файл

@@ -7985,7 +7985,7 @@ func (s *OpenTracingLayerUploadSessionStore) Update(session *model.UploadSession
return err
}
func (s *OpenTracingLayerUserStore) AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.AnalyticsActiveCount")
s.Root.Store.SetContext(newCtx)
@@ -8021,7 +8021,7 @@ func (s *OpenTracingLayerUserStore) AnalyticsActiveCountForPeriod(startTime int6
return result, err
}
func (s *OpenTracingLayerUserStore) AnalyticsGetExternalUsers(hostDomain string) (bool, *model.AppError) {
func (s *OpenTracingLayerUserStore) AnalyticsGetExternalUsers(hostDomain string) (bool, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.AnalyticsGetExternalUsers")
s.Root.Store.SetContext(newCtx)
@@ -8039,7 +8039,7 @@ func (s *OpenTracingLayerUserStore) AnalyticsGetExternalUsers(hostDomain string)
return result, err
}
func (s *OpenTracingLayerUserStore) AnalyticsGetGuestCount() (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) AnalyticsGetGuestCount() (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.AnalyticsGetGuestCount")
s.Root.Store.SetContext(newCtx)
@@ -8057,7 +8057,7 @@ func (s *OpenTracingLayerUserStore) AnalyticsGetGuestCount() (int64, *model.AppE
return result, err
}
func (s *OpenTracingLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.AnalyticsGetInactiveUsersCount")
s.Root.Store.SetContext(newCtx)
@@ -8075,7 +8075,7 @@ func (s *OpenTracingLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, *mo
return result, err
}
func (s *OpenTracingLayerUserStore) AnalyticsGetSystemAdminCount() (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) AnalyticsGetSystemAdminCount() (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.AnalyticsGetSystemAdminCount")
s.Root.Store.SetContext(newCtx)
@@ -8093,7 +8093,7 @@ func (s *OpenTracingLayerUserStore) AnalyticsGetSystemAdminCount() (int64, *mode
return result, err
}
func (s *OpenTracingLayerUserStore) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) {
func (s *OpenTracingLayerUserStore) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.AutocompleteUsersInChannel")
s.Root.Store.SetContext(newCtx)
@@ -8111,7 +8111,7 @@ func (s *OpenTracingLayerUserStore) AutocompleteUsersInChannel(teamId string, ch
return result, err
}
func (s *OpenTracingLayerUserStore) ClearAllCustomRoleAssignments() *model.AppError {
func (s *OpenTracingLayerUserStore) ClearAllCustomRoleAssignments() error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.ClearAllCustomRoleAssignments")
s.Root.Store.SetContext(newCtx)
@@ -8142,7 +8142,7 @@ func (s *OpenTracingLayerUserStore) ClearCaches() {
}
func (s *OpenTracingLayerUserStore) Count(options model.UserCountOptions) (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) Count(options model.UserCountOptions) (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.Count")
s.Root.Store.SetContext(newCtx)
@@ -8160,7 +8160,7 @@ func (s *OpenTracingLayerUserStore) Count(options model.UserCountOptions) (int64
return result, err
}
func (s *OpenTracingLayerUserStore) DeactivateGuests() ([]string, *model.AppError) {
func (s *OpenTracingLayerUserStore) DeactivateGuests() ([]string, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.DeactivateGuests")
s.Root.Store.SetContext(newCtx)
@@ -8178,7 +8178,7 @@ func (s *OpenTracingLayerUserStore) DeactivateGuests() ([]string, *model.AppErro
return result, err
}
func (s *OpenTracingLayerUserStore) DemoteUserToGuest(userID string) *model.AppError {
func (s *OpenTracingLayerUserStore) DemoteUserToGuest(userID string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.DemoteUserToGuest")
s.Root.Store.SetContext(newCtx)
@@ -8196,7 +8196,7 @@ func (s *OpenTracingLayerUserStore) DemoteUserToGuest(userID string) *model.AppE
return err
}
func (s *OpenTracingLayerUserStore) Get(id string) (*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) Get(id string) (*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.Get")
s.Root.Store.SetContext(newCtx)
@@ -8214,7 +8214,7 @@ func (s *OpenTracingLayerUserStore) Get(id string) (*model.User, *model.AppError
return result, err
}
func (s *OpenTracingLayerUserStore) GetAll() ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAll() ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAll")
s.Root.Store.SetContext(newCtx)
@@ -8232,7 +8232,7 @@ func (s *OpenTracingLayerUserStore) GetAll() ([]*model.User, *model.AppError) {
return result, err
}
func (s *OpenTracingLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAllAfter")
s.Root.Store.SetContext(newCtx)
@@ -8250,7 +8250,7 @@ func (s *OpenTracingLayerUserStore) GetAllAfter(limit int, afterId string) ([]*m
return result, err
}
func (s *OpenTracingLayerUserStore) GetAllNotInAuthService(authServices []string) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAllNotInAuthService(authServices []string) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAllNotInAuthService")
s.Root.Store.SetContext(newCtx)
@@ -8268,7 +8268,7 @@ func (s *OpenTracingLayerUserStore) GetAllNotInAuthService(authServices []string
return result, err
}
func (s *OpenTracingLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAllProfiles")
s.Root.Store.SetContext(newCtx)
@@ -8286,7 +8286,7 @@ func (s *OpenTracingLayerUserStore) GetAllProfiles(options *model.UserGetOptions
return result, err
}
func (s *OpenTracingLayerUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAllProfilesInChannel")
s.Root.Store.SetContext(newCtx)
@@ -8304,7 +8304,7 @@ func (s *OpenTracingLayerUserStore) GetAllProfilesInChannel(channelId string, al
return result, err
}
func (s *OpenTracingLayerUserStore) GetAllUsingAuthService(authService string) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAllUsingAuthService(authService string) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAllUsingAuthService")
s.Root.Store.SetContext(newCtx)
@@ -8322,7 +8322,7 @@ func (s *OpenTracingLayerUserStore) GetAllUsingAuthService(authService string) (
return result, err
}
func (s *OpenTracingLayerUserStore) GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetAnyUnreadPostCountForChannel")
s.Root.Store.SetContext(newCtx)
@@ -8340,7 +8340,7 @@ func (s *OpenTracingLayerUserStore) GetAnyUnreadPostCountForChannel(userId strin
return result, err
}
func (s *OpenTracingLayerUserStore) GetByAuth(authData *string, authService string) (*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetByAuth(authData *string, authService string) (*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetByAuth")
s.Root.Store.SetContext(newCtx)
@@ -8358,7 +8358,7 @@ func (s *OpenTracingLayerUserStore) GetByAuth(authData *string, authService stri
return result, err
}
func (s *OpenTracingLayerUserStore) GetByEmail(email string) (*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetByEmail(email string) (*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetByEmail")
s.Root.Store.SetContext(newCtx)
@@ -8376,7 +8376,7 @@ func (s *OpenTracingLayerUserStore) GetByEmail(email string) (*model.User, *mode
return result, err
}
func (s *OpenTracingLayerUserStore) GetByUsername(username string) (*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetByUsername(username string) (*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetByUsername")
s.Root.Store.SetContext(newCtx)
@@ -8394,7 +8394,7 @@ func (s *OpenTracingLayerUserStore) GetByUsername(username string) (*model.User,
return result, err
}
func (s *OpenTracingLayerUserStore) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetChannelGroupUsers(channelID string) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetChannelGroupUsers")
s.Root.Store.SetContext(newCtx)
@@ -8451,7 +8451,7 @@ func (s *OpenTracingLayerUserStore) GetEtagForProfilesNotInTeam(teamId string) s
return result
}
func (s *OpenTracingLayerUserStore) GetForLogin(loginId string, allowSignInWithUsername bool, allowSignInWithEmail bool) (*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetForLogin(loginId string, allowSignInWithUsername bool, allowSignInWithEmail bool) (*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetForLogin")
s.Root.Store.SetContext(newCtx)
@@ -8469,7 +8469,7 @@ func (s *OpenTracingLayerUserStore) GetForLogin(loginId string, allowSignInWithU
return result, err
}
func (s *OpenTracingLayerUserStore) GetKnownUsers(userID string) ([]string, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetKnownUsers(userID string) ([]string, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetKnownUsers")
s.Root.Store.SetContext(newCtx)
@@ -8487,7 +8487,7 @@ func (s *OpenTracingLayerUserStore) GetKnownUsers(userID string) ([]string, *mod
return result, err
}
func (s *OpenTracingLayerUserStore) GetNewUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetNewUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetNewUsersForTeam")
s.Root.Store.SetContext(newCtx)
@@ -8505,7 +8505,7 @@ func (s *OpenTracingLayerUserStore) GetNewUsersForTeam(teamId string, offset int
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfileByGroupChannelIdsForUser")
s.Root.Store.SetContext(newCtx)
@@ -8523,7 +8523,7 @@ func (s *OpenTracingLayerUserStore) GetProfileByGroupChannelIdsForUser(userId st
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfileByIds")
s.Root.Store.SetContext(newCtx)
@@ -8541,7 +8541,7 @@ func (s *OpenTracingLayerUserStore) GetProfileByIds(userIds []string, options *s
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfiles")
s.Root.Store.SetContext(newCtx)
@@ -8559,7 +8559,7 @@ func (s *OpenTracingLayerUserStore) GetProfiles(options *model.UserGetOptions) (
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesByUsernames")
s.Root.Store.SetContext(newCtx)
@@ -8577,7 +8577,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesByUsernames(usernames []string, v
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesInChannel")
s.Root.Store.SetContext(newCtx)
@@ -8595,7 +8595,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesInChannel(options *model.UserGetO
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesInChannelByStatus")
s.Root.Store.SetContext(newCtx)
@@ -8613,7 +8613,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesInChannelByStatus(options *model.
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesNotInChannel")
s.Root.Store.SetContext(newCtx)
@@ -8631,7 +8631,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesNotInChannel(teamId string, chann
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesNotInTeam")
s.Root.Store.SetContext(newCtx)
@@ -8649,7 +8649,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesNotInTeam(teamId string, groupCon
return result, err
}
func (s *OpenTracingLayerUserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfilesWithoutTeam")
s.Root.Store.SetContext(newCtx)
@@ -8667,7 +8667,7 @@ func (s *OpenTracingLayerUserStore) GetProfilesWithoutTeam(options *model.UserGe
return result, err
}
func (s *OpenTracingLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetRecentlyActiveUsersForTeam")
s.Root.Store.SetContext(newCtx)
@@ -8685,7 +8685,7 @@ func (s *OpenTracingLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string,
return result, err
}
func (s *OpenTracingLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetSystemAdminProfiles")
s.Root.Store.SetContext(newCtx)
@@ -8703,7 +8703,7 @@ func (s *OpenTracingLayerUserStore) GetSystemAdminProfiles() (map[string]*model.
return result, err
}
func (s *OpenTracingLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetTeamGroupUsers")
s.Root.Store.SetContext(newCtx)
@@ -8721,7 +8721,7 @@ func (s *OpenTracingLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.U
return result, err
}
func (s *OpenTracingLayerUserStore) GetUnreadCount(userId string) (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetUnreadCount(userId string) (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetUnreadCount")
s.Root.Store.SetContext(newCtx)
@@ -8739,7 +8739,7 @@ func (s *OpenTracingLayerUserStore) GetUnreadCount(userId string) (int64, *model
return result, err
}
func (s *OpenTracingLayerUserStore) GetUnreadCountForChannel(userId string, channelId string) (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetUnreadCountForChannel(userId string, channelId string) (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetUnreadCountForChannel")
s.Root.Store.SetContext(newCtx)
@@ -8757,7 +8757,7 @@ func (s *OpenTracingLayerUserStore) GetUnreadCountForChannel(userId string, chan
return result, err
}
func (s *OpenTracingLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.UserForIndexing, *model.AppError) {
func (s *OpenTracingLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.UserForIndexing, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetUsersBatchForIndexing")
s.Root.Store.SetContext(newCtx)
@@ -8775,7 +8775,7 @@ func (s *OpenTracingLayerUserStore) GetUsersBatchForIndexing(startTime int64, en
return result, err
}
func (s *OpenTracingLayerUserStore) InferSystemInstallDate() (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) InferSystemInstallDate() (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.InferSystemInstallDate")
s.Root.Store.SetContext(newCtx)
@@ -8832,7 +8832,7 @@ func (s *OpenTracingLayerUserStore) InvalidateProfilesInChannelCacheByUser(userI
}
func (s *OpenTracingLayerUserStore) PermanentDelete(userId string) *model.AppError {
func (s *OpenTracingLayerUserStore) PermanentDelete(userId string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.PermanentDelete")
s.Root.Store.SetContext(newCtx)
@@ -8850,7 +8850,7 @@ func (s *OpenTracingLayerUserStore) PermanentDelete(userId string) *model.AppErr
return err
}
func (s *OpenTracingLayerUserStore) PromoteGuestToUser(userID string) *model.AppError {
func (s *OpenTracingLayerUserStore) PromoteGuestToUser(userID string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.PromoteGuestToUser")
s.Root.Store.SetContext(newCtx)
@@ -8868,7 +8868,7 @@ func (s *OpenTracingLayerUserStore) PromoteGuestToUser(userID string) *model.App
return err
}
func (s *OpenTracingLayerUserStore) ResetLastPictureUpdate(userId string) *model.AppError {
func (s *OpenTracingLayerUserStore) ResetLastPictureUpdate(userId string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.ResetLastPictureUpdate")
s.Root.Store.SetContext(newCtx)
@@ -8886,7 +8886,7 @@ func (s *OpenTracingLayerUserStore) ResetLastPictureUpdate(userId string) *model
return err
}
func (s *OpenTracingLayerUserStore) Save(user *model.User) (*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) Save(user *model.User) (*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.Save")
s.Root.Store.SetContext(newCtx)
@@ -8904,7 +8904,7 @@ func (s *OpenTracingLayerUserStore) Save(user *model.User) (*model.User, *model.
return result, err
}
func (s *OpenTracingLayerUserStore) Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.Search")
s.Root.Store.SetContext(newCtx)
@@ -8922,7 +8922,7 @@ func (s *OpenTracingLayerUserStore) Search(teamId string, term string, options *
return result, err
}
func (s *OpenTracingLayerUserStore) SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.SearchInChannel")
s.Root.Store.SetContext(newCtx)
@@ -8940,7 +8940,7 @@ func (s *OpenTracingLayerUserStore) SearchInChannel(channelId string, term strin
return result, err
}
func (s *OpenTracingLayerUserStore) SearchInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) SearchInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.SearchInGroup")
s.Root.Store.SetContext(newCtx)
@@ -8958,7 +8958,7 @@ func (s *OpenTracingLayerUserStore) SearchInGroup(groupID string, term string, o
return result, err
}
func (s *OpenTracingLayerUserStore) SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.SearchNotInChannel")
s.Root.Store.SetContext(newCtx)
@@ -8976,7 +8976,7 @@ func (s *OpenTracingLayerUserStore) SearchNotInChannel(teamId string, channelId
return result, err
}
func (s *OpenTracingLayerUserStore) SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.SearchNotInTeam")
s.Root.Store.SetContext(newCtx)
@@ -8994,7 +8994,7 @@ func (s *OpenTracingLayerUserStore) SearchNotInTeam(notInTeamId string, term str
return result, err
}
func (s *OpenTracingLayerUserStore) SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *OpenTracingLayerUserStore) SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.SearchWithoutTeam")
s.Root.Store.SetContext(newCtx)
@@ -9012,7 +9012,7 @@ func (s *OpenTracingLayerUserStore) SearchWithoutTeam(term string, options *mode
return result, err
}
func (s *OpenTracingLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, *model.AppError) {
func (s *OpenTracingLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.Update")
s.Root.Store.SetContext(newCtx)
@@ -9030,7 +9030,7 @@ func (s *OpenTracingLayerUserStore) Update(user *model.User, allowRoleUpdate boo
return result, err
}
func (s *OpenTracingLayerUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, *model.AppError) {
func (s *OpenTracingLayerUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdateAuthData")
s.Root.Store.SetContext(newCtx)
@@ -9048,7 +9048,7 @@ func (s *OpenTracingLayerUserStore) UpdateAuthData(userId string, service string
return result, err
}
func (s *OpenTracingLayerUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) *model.AppError {
func (s *OpenTracingLayerUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdateFailedPasswordAttempts")
s.Root.Store.SetContext(newCtx)
@@ -9066,7 +9066,7 @@ func (s *OpenTracingLayerUserStore) UpdateFailedPasswordAttempts(userId string,
return err
}
func (s *OpenTracingLayerUserStore) UpdateLastPictureUpdate(userId string) *model.AppError {
func (s *OpenTracingLayerUserStore) UpdateLastPictureUpdate(userId string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdateLastPictureUpdate")
s.Root.Store.SetContext(newCtx)
@@ -9084,7 +9084,7 @@ func (s *OpenTracingLayerUserStore) UpdateLastPictureUpdate(userId string) *mode
return err
}
func (s *OpenTracingLayerUserStore) UpdateMfaActive(userId string, active bool) *model.AppError {
func (s *OpenTracingLayerUserStore) UpdateMfaActive(userId string, active bool) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdateMfaActive")
s.Root.Store.SetContext(newCtx)
@@ -9102,7 +9102,7 @@ func (s *OpenTracingLayerUserStore) UpdateMfaActive(userId string, active bool)
return err
}
func (s *OpenTracingLayerUserStore) UpdateMfaSecret(userId string, secret string) *model.AppError {
func (s *OpenTracingLayerUserStore) UpdateMfaSecret(userId string, secret string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdateMfaSecret")
s.Root.Store.SetContext(newCtx)
@@ -9120,7 +9120,7 @@ func (s *OpenTracingLayerUserStore) UpdateMfaSecret(userId string, secret string
return err
}
func (s *OpenTracingLayerUserStore) UpdatePassword(userId string, newPassword string) *model.AppError {
func (s *OpenTracingLayerUserStore) UpdatePassword(userId string, newPassword string) error {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdatePassword")
s.Root.Store.SetContext(newCtx)
@@ -9138,7 +9138,7 @@ func (s *OpenTracingLayerUserStore) UpdatePassword(userId string, newPassword st
return err
}
func (s *OpenTracingLayerUserStore) UpdateUpdateAt(userId string) (int64, *model.AppError) {
func (s *OpenTracingLayerUserStore) UpdateUpdateAt(userId string) (int64, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.UpdateUpdateAt")
s.Root.Store.SetContext(newCtx)
@@ -9156,7 +9156,7 @@ func (s *OpenTracingLayerUserStore) UpdateUpdateAt(userId string) (int64, *model
return result, err
}
func (s *OpenTracingLayerUserStore) VerifyEmail(userId string, email string) (string, *model.AppError) {
func (s *OpenTracingLayerUserStore) VerifyEmail(userId string, email string) (string, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.VerifyEmail")
s.Root.Store.SetContext(newCtx)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@@ -33,7 +33,7 @@ func (s *SearchUserStore) deleteUserIndex(user *model.User) {
}
}
func (s *SearchUserStore) Search(teamId, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *SearchUserStore) Search(teamId, term string, options *model.UserSearchOptions) ([]*model.User, error) {
for _, engine := range s.rootStore.searchEngine.GetActiveEngines() {
if engine.IsSearchEnabled() {
listOfAllowedChannels, err := s.getListOfAllowedChannelsForTeam(teamId, options.ViewRestrictions)
@@ -54,9 +54,9 @@ func (s *SearchUserStore) Search(teamId, term string, options *model.UserSearchO
continue
}
users, err := s.UserStore.GetProfileByIds(usersIds, nil, false)
if err != nil {
mlog.Error("Encountered error on Search", mlog.String("search_engine", engine.GetName()), mlog.Err(err))
users, nErr := s.UserStore.GetProfileByIds(usersIds, nil, false)
if nErr != nil {
mlog.Error("Encountered error on Search", mlog.String("search_engine", engine.GetName()), mlog.Err(nErr))
continue
}
@@ -70,7 +70,7 @@ func (s *SearchUserStore) Search(teamId, term string, options *model.UserSearchO
return s.UserStore.Search(teamId, term, options)
}
func (s *SearchUserStore) Update(user *model.User, trustedUpdateData bool) (*model.UserUpdate, *model.AppError) {
func (s *SearchUserStore) Update(user *model.User, trustedUpdateData bool) (*model.UserUpdate, error) {
userUpdate, err := s.UserStore.Update(user, trustedUpdateData)
if err == nil {
@@ -79,7 +79,7 @@ func (s *SearchUserStore) Update(user *model.User, trustedUpdateData bool) (*mod
return userUpdate, err
}
func (s *SearchUserStore) Save(user *model.User) (*model.User, *model.AppError) {
func (s *SearchUserStore) Save(user *model.User) (*model.User, error) {
nuser, err := s.UserStore.Save(user)
if err == nil {
@@ -88,7 +88,7 @@ func (s *SearchUserStore) Save(user *model.User) (*model.User, *model.AppError)
return nuser, err
}
func (s *SearchUserStore) PermanentDelete(userId string) *model.AppError {
func (s *SearchUserStore) PermanentDelete(userId string) error {
user, userErr := s.UserStore.Get(userId)
if userErr != nil {
mlog.Error("Encountered error deleting user", mlog.String("user_id", userId), mlog.Err(userErr))
@@ -117,29 +117,29 @@ func (s *SearchUserStore) autocompleteUsersInChannelByEngine(engine searchengine
uchan := make(chan store.StoreResult, 1)
go func() {
users, err := s.UserStore.GetProfileByIds(uchanIds, nil, false)
uchan <- store.StoreResult{Data: users, Err: err}
uchan <- store.StoreResult{Data: users, NErr: err}
close(uchan)
}()
nuchan := make(chan store.StoreResult, 1)
go func() {
users, err := s.UserStore.GetProfileByIds(nuchanIds, nil, false)
nuchan <- store.StoreResult{Data: users, Err: err}
nuchan <- store.StoreResult{Data: users, NErr: err}
close(nuchan)
}()
autocomplete := &model.UserAutocompleteInChannel{}
result := <-uchan
if result.Err != nil {
return nil, result.Err
if result.NErr != nil {
return nil, model.NewAppError("autocompleteUsersInChannelByEngine", "app.user.get_profiles.app_error", nil, result.NErr.Error(), http.StatusInternalServerError)
}
inUsers := result.Data.([]*model.User)
autocomplete.InChannel = inUsers
result = <-nuchan
if result.Err != nil {
return nil, result.Err
if result.NErr != nil {
return nil, model.NewAppError("autocompleteUsersInChannelByEngine", "app.user.get_profiles.app_error", nil, result.NErr.Error(), http.StatusInternalServerError)
}
outUsers := result.Data.([]*model.User)
autocomplete.OutOfChannel = outUsers
@@ -198,7 +198,7 @@ func (s *SearchUserStore) getListOfAllowedChannelsForTeam(teamId string, viewRes
return []string{}, nil
}
func (s *SearchUserStore) AutocompleteUsersInChannel(teamId, channelId, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) {
func (s *SearchUserStore) AutocompleteUsersInChannel(teamId, channelId, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, error) {
for _, engine := range s.rootStore.searchEngine.GetActiveEngines() {
if engine.IsAutocompletionEnabled() {
listOfAllowedChannels, err := s.getListOfAllowedChannelsForTeam(teamId, options.ViewRestrictions)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@@ -304,74 +304,74 @@ type PostStore interface {
}
type UserStore interface {
Save(user *model.User) (*model.User, *model.AppError)
Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, *model.AppError)
UpdateLastPictureUpdate(userId string) *model.AppError
ResetLastPictureUpdate(userId string) *model.AppError
UpdatePassword(userId, newPassword string) *model.AppError
UpdateUpdateAt(userId string) (int64, *model.AppError)
UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, *model.AppError)
UpdateMfaSecret(userId, secret string) *model.AppError
UpdateMfaActive(userId string, active bool) *model.AppError
Get(id string) (*model.User, *model.AppError)
GetAll() ([]*model.User, *model.AppError)
Save(user *model.User) (*model.User, error)
Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, error)
UpdateLastPictureUpdate(userId string) error
ResetLastPictureUpdate(userId string) error
UpdatePassword(userId, newPassword string) error
UpdateUpdateAt(userId string) (int64, error)
UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, error)
UpdateMfaSecret(userId, secret string) error
UpdateMfaActive(userId string, active bool) error
Get(id string) (*model.User, error)
GetAll() ([]*model.User, error)
ClearCaches()
InvalidateProfilesInChannelCacheByUser(userId string)
InvalidateProfilesInChannelCache(channelId string)
GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError)
GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError)
GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, *model.AppError)
GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError)
GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
GetAllProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError)
GetProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError)
GetProfileByIds(userIds []string, options *UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError)
GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, *model.AppError)
GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, error)
GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, error)
GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, error)
GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, error)
GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
GetAllProfiles(options *model.UserGetOptions) ([]*model.User, error)
GetProfiles(options *model.UserGetOptions) ([]*model.User, error)
GetProfileByIds(userIds []string, options *UserGetByIdsOpts, allowFromCache bool) ([]*model.User, error)
GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, error)
InvalidateProfileCacheForUser(userId string)
GetByEmail(email string) (*model.User, *model.AppError)
GetByAuth(authData *string, authService string) (*model.User, *model.AppError)
GetAllUsingAuthService(authService string) ([]*model.User, *model.AppError)
GetAllNotInAuthService(authServices []string) ([]*model.User, *model.AppError)
GetByUsername(username string) (*model.User, *model.AppError)
GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail bool) (*model.User, *model.AppError)
VerifyEmail(userId, email string) (string, *model.AppError)
GetByEmail(email string) (*model.User, error)
GetByAuth(authData *string, authService string) (*model.User, error)
GetAllUsingAuthService(authService string) ([]*model.User, error)
GetAllNotInAuthService(authServices []string) ([]*model.User, error)
GetByUsername(username string) (*model.User, error)
GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail bool) (*model.User, error)
VerifyEmail(userId, email string) (string, error)
GetEtagForAllProfiles() string
GetEtagForProfiles(teamId string) string
UpdateFailedPasswordAttempts(userId string, attempts int) *model.AppError
GetSystemAdminProfiles() (map[string]*model.User, *model.AppError)
PermanentDelete(userId string) *model.AppError
AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, *model.AppError)
UpdateFailedPasswordAttempts(userId string, attempts int) error
GetSystemAdminProfiles() (map[string]*model.User, error)
PermanentDelete(userId string) error
AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, error)
AnalyticsActiveCountForPeriod(startTime int64, endTime int64, options model.UserCountOptions) (int64, error)
GetUnreadCount(userId string) (int64, *model.AppError)
GetUnreadCountForChannel(userId string, channelId string) (int64, *model.AppError)
GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, *model.AppError)
GetRecentlyActiveUsersForTeam(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
GetNewUsersForTeam(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
SearchInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
AnalyticsGetInactiveUsersCount() (int64, *model.AppError)
AnalyticsGetExternalUsers(hostDomain string) (bool, *model.AppError)
AnalyticsGetSystemAdminCount() (int64, *model.AppError)
AnalyticsGetGuestCount() (int64, *model.AppError)
GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
GetUnreadCount(userId string) (int64, error)
GetUnreadCountForChannel(userId string, channelId string) (int64, error)
GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, error)
GetRecentlyActiveUsersForTeam(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
GetNewUsersForTeam(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, error)
SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, error)
SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, error)
SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, error)
SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, error)
SearchInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, error)
AnalyticsGetInactiveUsersCount() (int64, error)
AnalyticsGetExternalUsers(hostDomain string) (bool, error)
AnalyticsGetSystemAdminCount() (int64, error)
AnalyticsGetGuestCount() (int64, error)
GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error)
GetEtagForProfilesNotInTeam(teamId string) string
ClearAllCustomRoleAssignments() *model.AppError
InferSystemInstallDate() (int64, *model.AppError)
GetAllAfter(limit int, afterId string) ([]*model.User, *model.AppError)
GetUsersBatchForIndexing(startTime, endTime int64, limit int) ([]*model.UserForIndexing, *model.AppError)
Count(options model.UserCountOptions) (int64, *model.AppError)
GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError)
GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError)
PromoteGuestToUser(userID string) *model.AppError
DemoteUserToGuest(userID string) *model.AppError
DeactivateGuests() ([]string, *model.AppError)
AutocompleteUsersInChannel(teamId, channelId, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError)
GetKnownUsers(userID string) ([]string, *model.AppError)
ClearAllCustomRoleAssignments() error
InferSystemInstallDate() (int64, error)
GetAllAfter(limit int, afterId string) ([]*model.User, error)
GetUsersBatchForIndexing(startTime, endTime int64, limit int) ([]*model.UserForIndexing, error)
Count(options model.UserCountOptions) (int64, error)
GetTeamGroupUsers(teamID string) ([]*model.User, error)
GetChannelGroupUsers(channelID string) ([]*model.User, error)
PromoteGuestToUser(userID string) error
DemoteUserToGuest(userID string) error
DeactivateGuests() ([]string, error)
AutocompleteUsersInChannel(teamId, channelId, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, error)
GetKnownUsers(userID string) ([]string, error)
}
type BotStore interface {

Просмотреть файл

@@ -4470,8 +4470,8 @@ func testGetMemberCountsByGroup(t *testing.T, ss store.Store) {
Email: MakeEmail(),
DeleteAt: 0,
}
_, err = ss.User().Save(u1)
require.Nil(t, err)
_, nErr = ss.User().Save(u1)
require.Nil(t, nErr)
_, nErr = ss.Team().SaveMember(&model.TeamMember{TeamId: teamId, UserId: u1.Id}, -1)
require.Nil(t, nErr)
@@ -4541,8 +4541,8 @@ func testGetMemberCountsByGroup(t *testing.T, ss store.Store) {
Email: MakeEmail(),
DeleteAt: 0,
}
_, err = ss.User().Save(u)
require.Nil(t, err)
_, nErr = ss.User().Save(u)
require.Nil(t, nErr)
_, nErr = ss.Team().SaveMember(&model.TeamMember{TeamId: teamId, UserId: u.Id}, -1)
require.Nil(t, nErr)
@@ -4592,8 +4592,8 @@ func testGetMemberCountsByGroup(t *testing.T, ss store.Store) {
Email: MakeEmail(),
DeleteAt: 0,
}
_, err = ss.User().Save(u)
require.Nil(t, err)
_, nErr = ss.User().Save(u)
require.Nil(t, nErr)
_, nErr = ss.Team().SaveMember(&model.TeamMember{TeamId: teamId, UserId: u.Id}, -1)
require.Nil(t, nErr)

Просмотреть файл

@@ -374,8 +374,8 @@ func testGroupStoreGetByUser(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
u1, err = ss.User().Save(u1)
require.Nil(t, err)
u1, nErr := ss.User().Save(u1)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(g1.Id, u1.Id)
require.Nil(t, err)
@@ -386,8 +386,8 @@ func testGroupStoreGetByUser(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
u2, err = ss.User().Save(u2)
require.Nil(t, err)
u2, nErr = ss.User().Save(u2)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(g2.Id, u2.Id)
require.Nil(t, err)
@@ -571,8 +571,8 @@ func testGroupGetMemberUsers(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user1, err := ss.User().Save(u1)
require.Nil(t, err)
user1, nErr := ss.User().Save(u1)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(group.Id, user1.Id)
require.Nil(t, err)
@@ -581,8 +581,8 @@ func testGroupGetMemberUsers(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user2, err := ss.User().Save(u2)
require.Nil(t, err)
user2, nErr := ss.User().Save(u2)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(group.Id, user2.Id)
require.Nil(t, err)
@@ -623,8 +623,8 @@ func testGroupGetMemberUsersPage(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user1, err := ss.User().Save(u1)
require.Nil(t, err)
user1, nErr := ss.User().Save(u1)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(group.Id, user1.Id)
require.Nil(t, err)
@@ -633,8 +633,8 @@ func testGroupGetMemberUsersPage(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user2, err := ss.User().Save(u2)
require.Nil(t, err)
user2, nErr := ss.User().Save(u2)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(group.Id, user2.Id)
require.Nil(t, err)
@@ -643,8 +643,8 @@ func testGroupGetMemberUsersPage(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user3, err := ss.User().Save(u3)
require.Nil(t, err)
user3, nErr := ss.User().Save(u3)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(group.Id, user3.Id)
require.Nil(t, err)
@@ -923,8 +923,8 @@ func testUpsertMember(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user, err := ss.User().Save(u1)
require.Nil(t, err)
user, nErr := ss.User().Save(u1)
require.Nil(t, nErr)
// Happy path
d2, err := ss.Group().UpsertMember(group.Id, user.Id)
@@ -981,8 +981,8 @@ func testGroupDeleteMember(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user, err := ss.User().Save(u1)
require.Nil(t, err)
user, nErr := ss.User().Save(u1)
require.Nil(t, nErr)
// Create member
d1, err := ss.Group().UpsertMember(group.Id, user.Id)
@@ -1321,8 +1321,8 @@ func testTeamMembersToAdd(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user, err = ss.User().Save(user)
require.Nil(t, err)
user, nErr := ss.User().Save(user)
require.Nil(t, nErr)
// Create GroupMember
_, err = ss.Group().UpsertMember(group.Id, user.Id)
@@ -1339,7 +1339,7 @@ func testTeamMembersToAdd(t *testing.T, ss store.Store) {
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
Type: model.TEAM_OPEN,
}
team, nErr := ss.Team().Save(team)
team, nErr = ss.Team().Save(team)
require.Nil(t, nErr)
// Create GroupTeam
@@ -1490,22 +1490,22 @@ func testTeamMembersToAddSingleTeam(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user1, err = ss.User().Save(user1)
require.Nil(t, err)
user1, nErr := ss.User().Save(user1)
require.Nil(t, nErr)
user2 := &model.User{
Email: MakeEmail(),
Username: model.NewId(),
}
user2, err = ss.User().Save(user2)
require.Nil(t, err)
user2, nErr = ss.User().Save(user2)
require.Nil(t, nErr)
user3 := &model.User{
Email: MakeEmail(),
Username: model.NewId(),
}
user3, err = ss.User().Save(user3)
require.Nil(t, err)
user3, nErr = ss.User().Save(user3)
require.Nil(t, nErr)
for _, user := range []*model.User{user1, user2} {
_, err = ss.Group().UpsertMember(group1.Id, user.Id)
@@ -1524,7 +1524,7 @@ func testTeamMembersToAddSingleTeam(t *testing.T, ss store.Store) {
Email: "success+" + model.NewId() + "@simulator.amazonses.com",
Type: model.TEAM_OPEN,
}
team1, nErr := ss.Team().Save(team1)
team1, nErr = ss.Team().Save(team1)
require.Nil(t, nErr)
team2 := &model.Team{
@@ -1574,8 +1574,8 @@ func testChannelMembersToAdd(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user, err = ss.User().Save(user)
require.Nil(t, err)
user, nErr := ss.User().Save(user)
require.Nil(t, nErr)
// Create GroupMember
_, err = ss.Group().UpsertMember(group.Id, user.Id)
@@ -1588,7 +1588,7 @@ func testChannelMembersToAdd(t *testing.T, ss store.Store) {
Name: model.NewId(),
Type: model.CHANNEL_OPEN, // Query does not look at type so this shouldn't matter.
}
channel, nErr := ss.Channel().Save(channel, 9999)
channel, nErr = ss.Channel().Save(channel, 9999)
require.Nil(t, nErr)
// Create GroupChannel
@@ -1749,22 +1749,22 @@ func testChannelMembersToAddSingleChannel(t *testing.T, ss store.Store) {
Email: MakeEmail(),
Username: model.NewId(),
}
user1, err = ss.User().Save(user1)
require.Nil(t, err)
user1, nErr := ss.User().Save(user1)
require.Nil(t, nErr)
user2 := &model.User{
Email: MakeEmail(),
Username: model.NewId(),
}
user2, err = ss.User().Save(user2)
require.Nil(t, err)
user2, nErr = ss.User().Save(user2)
require.Nil(t, nErr)
user3 := &model.User{
Email: MakeEmail(),
Username: model.NewId(),
}
user3, err = ss.User().Save(user3)
require.Nil(t, err)
user3, nErr = ss.User().Save(user3)
require.Nil(t, nErr)
for _, user := range []*model.User{user1, user2} {
_, err = ss.Group().UpsertMember(group1.Id, user.Id)
@@ -1778,7 +1778,7 @@ func testChannelMembersToAddSingleChannel(t *testing.T, ss store.Store) {
Name: "z-z-" + model.NewId() + "a",
Type: model.CHANNEL_OPEN,
}
channel1, nErr := ss.Channel().Save(channel1, 999)
channel1, nErr = ss.Channel().Save(channel1, 999)
require.Nil(t, nErr)
channel2 := &model.Channel{
@@ -2131,24 +2131,24 @@ func pendingMemberRemovalsDataSetup(t *testing.T, ss store.Store) *removalsData
Email: MakeEmail(),
Username: model.NewId(),
}
userA, err = ss.User().Save(userA)
require.Nil(t, err)
userA, nErr := ss.User().Save(userA)
require.Nil(t, nErr)
// userB will not get removed from the group
userB := &model.User{
Email: MakeEmail(),
Username: model.NewId(),
}
userB, err = ss.User().Save(userB)
require.Nil(t, err)
userB, nErr = ss.User().Save(userB)
require.Nil(t, nErr)
// userC was never in the group
userC := &model.User{
Email: MakeEmail(),
Username: model.NewId(),
}
userC, err = ss.User().Save(userC)
require.Nil(t, err)
userC, nErr = ss.User().Save(userC)
require.Nil(t, nErr)
// add users to group (but not userC)
_, err = ss.Group().UpsertMember(group.Id, userA.Id)
@@ -2165,7 +2165,7 @@ func pendingMemberRemovalsDataSetup(t *testing.T, ss store.Store) *removalsData
Type: model.CHANNEL_PRIVATE,
GroupConstrained: model.NewBool(true),
}
channelConstrained, nErr := ss.Channel().Save(channelConstrained, 9999)
channelConstrained, nErr = ss.Channel().Save(channelConstrained, 9999)
require.Nil(t, nErr)
channelUnconstrained := &model.Channel{
@@ -3747,14 +3747,14 @@ func groupTestGetMemberCount(t *testing.T, ss store.Store) {
require.Nil(t, err)
var user *model.User
var nErr error
for i := 0; i < 2; i++ {
user = &model.User{
Email: MakeEmail(),
Username: fmt.Sprintf("%d_%s", i, model.NewId()),
}
user, err = ss.User().Save(user)
require.Nil(t, err)
user, nErr = ss.User().Save(user)
require.Nil(t, nErr)
_, err = ss.Group().UpsertMember(group.Id, user.Id)
require.Nil(t, err)
@@ -3765,8 +3765,8 @@ func groupTestGetMemberCount(t *testing.T, ss store.Store) {
require.Equal(t, int64(2), count)
user.DeleteAt = 1
_, err = ss.User().Update(user, true)
require.Nil(t, err)
_, nErr = ss.User().Update(user, true)
require.Nil(t, nErr)
count, err = ss.Group().GetMemberCount(group.Id)
require.Nil(t, err)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@@ -2785,17 +2785,17 @@ func testSaveTeamMemberMaxMembers(t *testing.T, ss store.Store) {
require.Nil(t, err)
require.Equal(t, int(totalMemberCount), maxUsersPerTeam, "should start with 5 team members, had %v instead", totalMemberCount)
user, err := ss.User().Save(&model.User{
user, nErr := ss.User().Save(&model.User{
Username: model.NewId(),
Email: MakeEmail(),
})
require.Nil(t, err)
require.Nil(t, nErr)
newUserId := user.Id
defer func() {
ss.User().PermanentDelete(newUserId)
}()
_, nErr := ss.Team().SaveMember(&model.TeamMember{
_, nErr = ss.Team().SaveMember(&model.TeamMember{
TeamId: team.Id,
UserId: newUserId,
}, maxUsersPerTeam)
@@ -2827,17 +2827,17 @@ func testSaveTeamMemberMaxMembers(t *testing.T, ss store.Store) {
require.Equal(t, maxUsersPerTeam, int(totalMemberCount), "should have 5 team members again, had %v instead", totalMemberCount)
// Deactivating a user should make them stop counting against max members
user2, err := ss.User().Get(userIds[1])
require.Nil(t, err)
user2, nErr := ss.User().Get(userIds[1])
require.Nil(t, nErr)
user2.DeleteAt = 1234
_, err = ss.User().Update(user2, true)
require.Nil(t, err)
_, nErr = ss.User().Update(user2, true)
require.Nil(t, nErr)
user, err = ss.User().Save(&model.User{
user, nErr = ss.User().Save(&model.User{
Username: model.NewId(),
Email: MakeEmail(),
})
require.Nil(t, err)
require.Nil(t, nErr)
newUserId2 := user.Id
_, nErr = ss.Team().SaveMember(&model.TeamMember{TeamId: team.Id, UserId: newUserId2}, maxUsersPerTeam)
require.Nil(t, nErr, "should've been able to save new member after deleting one")

Просмотреть файл

@@ -4,6 +4,7 @@
package storetest
import (
"errors"
"strings"
"testing"
"time"
@@ -1788,13 +1789,11 @@ func testUserStoreGetByEmail(t *testing.T, ss store.Store) {
t.Run("get by empty email", func(t *testing.T) {
_, err := ss.User().GetByEmail("")
require.NotNil(t, err)
require.Equal(t, err.Id, store.MISSING_ACCOUNT_ERROR)
})
t.Run("get by unknown", func(t *testing.T) {
_, err := ss.User().GetByEmail("unknown")
require.NotNil(t, err)
require.Equal(t, err.Id, store.MISSING_ACCOUNT_ERROR)
})
}
@@ -1857,21 +1856,24 @@ func testUserStoreGetByAuthData(t *testing.T, ss store.Store) {
t.Run("get by u1 auth, unknown service", func(t *testing.T) {
_, err := ss.User().GetByAuth(u1.AuthData, "unknown")
require.NotNil(t, err)
require.Equal(t, err.Id, store.MISSING_AUTH_ACCOUNT_ERROR)
var nfErr *store.ErrNotFound
require.True(t, errors.As(err, &nfErr))
})
t.Run("get by unknown auth, u1 service", func(t *testing.T) {
unknownAuth := ""
_, err := ss.User().GetByAuth(&unknownAuth, u1.AuthService)
require.NotNil(t, err)
require.Equal(t, err.Id, store.MISSING_AUTH_ACCOUNT_ERROR)
var invErr *store.ErrInvalidInput
require.True(t, errors.As(err, &invErr))
})
t.Run("get by unknown auth, unknown service", func(t *testing.T) {
unknownAuth := ""
_, err := ss.User().GetByAuth(&unknownAuth, "unknown")
require.NotNil(t, err)
require.Equal(t, err.Id, store.MISSING_AUTH_ACCOUNT_ERROR)
var invErr *store.ErrInvalidInput
require.True(t, errors.As(err, &invErr))
})
}
@@ -1934,13 +1936,15 @@ func testUserStoreGetByUsername(t *testing.T, ss store.Store) {
t.Run("get by empty username", func(t *testing.T) {
_, err := ss.User().GetByUsername("")
require.NotNil(t, err)
require.Equal(t, err.Id, "store.sql_user.get_by_username.app_error")
var nfErr *store.ErrNotFound
require.True(t, errors.As(err, &nfErr))
})
t.Run("get by unknown", func(t *testing.T) {
_, err := ss.User().GetByUsername("unknown")
require.NotNil(t, err)
require.Equal(t, err.Id, "store.sql_user.get_by_username.app_error")
var nfErr *store.ErrNotFound
require.True(t, errors.As(err, &nfErr))
})
}
@@ -2007,7 +2011,7 @@ func testUserStoreGetForLogin(t *testing.T, ss store.Store) {
t.Run("get u1 by username, allow only email", func(t *testing.T) {
_, err := ss.User().GetForLogin(u1.Username, false, true)
require.NotNil(t, err)
require.Equal(t, err.Id, "store.sql_user.get_for_login.app_error")
require.Equal(t, "user not found", err.Error())
})
t.Run("get u1 by email, allow both", func(t *testing.T) {
@@ -2025,7 +2029,7 @@ func testUserStoreGetForLogin(t *testing.T, ss store.Store) {
t.Run("get u1 by email, allow only username", func(t *testing.T) {
_, err := ss.User().GetForLogin(u1.Email, true, false)
require.NotNil(t, err)
require.Equal(t, err.Id, "store.sql_user.get_for_login.app_error")
require.Equal(t, "user not found", err.Error())
})
t.Run("get u2 by username, allow both", func(t *testing.T) {
@@ -2043,7 +2047,7 @@ func testUserStoreGetForLogin(t *testing.T, ss store.Store) {
t.Run("get u2 by username, allow neither", func(t *testing.T) {
_, err := ss.User().GetForLogin(u2.Username, false, false)
require.NotNil(t, err)
require.Equal(t, err.Id, "store.sql_user.get_for_login.app_error")
require.Equal(t, "sign in with username and email are disabled", err.Error())
})
}
@@ -3949,12 +3953,12 @@ func testUserStoreAnalyticsGetSystemAdminCount(t *testing.T, ss store.Store) {
u2.Email = MakeEmail()
u2.Username = model.NewId()
_, err = ss.User().Save(&u1)
require.Nil(t, err, "couldn't save user")
_, nErr := ss.User().Save(&u1)
require.Nil(t, nErr, "couldn't save user")
defer func() { require.Nil(t, ss.User().PermanentDelete(u1.Id)) }()
_, err = ss.User().Save(&u2)
require.Nil(t, err, "couldn't save user")
_, nErr = ss.User().Save(&u2)
require.Nil(t, nErr, "couldn't save user")
defer func() { require.Nil(t, ss.User().PermanentDelete(u2.Id)) }()
@@ -3983,16 +3987,16 @@ func testUserStoreAnalyticsGetGuestCount(t *testing.T, ss store.Store) {
u3.Username = model.NewId()
u3.Roles = "system_guest"
_, err = ss.User().Save(&u1)
require.Nil(t, err, "couldn't save user")
_, nErr := ss.User().Save(&u1)
require.Nil(t, nErr, "couldn't save user")
defer func() { require.Nil(t, ss.User().PermanentDelete(u1.Id)) }()
_, err = ss.User().Save(&u2)
require.Nil(t, err, "couldn't save user")
_, nErr = ss.User().Save(&u2)
require.Nil(t, nErr, "couldn't save user")
defer func() { require.Nil(t, ss.User().PermanentDelete(u2.Id)) }()
_, err = ss.User().Save(&u3)
require.Nil(t, err, "couldn't save user")
_, nErr = ss.User().Save(&u3)
require.Nil(t, nErr, "couldn't save user")
defer func() { require.Nil(t, ss.User().PermanentDelete(u3.Id)) }()
result, err := ss.User().AnalyticsGetGuestCount()

Просмотреть файл

@@ -7207,7 +7207,7 @@ func (s *TimerLayerUploadSessionStore) Update(session *model.UploadSession) erro
return err
}
func (s *TimerLayerUserStore) AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, *model.AppError) {
func (s *TimerLayerUserStore) AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.AnalyticsActiveCount(time, options)
@@ -7239,7 +7239,7 @@ func (s *TimerLayerUserStore) AnalyticsActiveCountForPeriod(startTime int64, end
return result, err
}
func (s *TimerLayerUserStore) AnalyticsGetExternalUsers(hostDomain string) (bool, *model.AppError) {
func (s *TimerLayerUserStore) AnalyticsGetExternalUsers(hostDomain string) (bool, error) {
start := timemodule.Now()
result, err := s.UserStore.AnalyticsGetExternalUsers(hostDomain)
@@ -7255,7 +7255,7 @@ func (s *TimerLayerUserStore) AnalyticsGetExternalUsers(hostDomain string) (bool
return result, err
}
func (s *TimerLayerUserStore) AnalyticsGetGuestCount() (int64, *model.AppError) {
func (s *TimerLayerUserStore) AnalyticsGetGuestCount() (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.AnalyticsGetGuestCount()
@@ -7271,7 +7271,7 @@ func (s *TimerLayerUserStore) AnalyticsGetGuestCount() (int64, *model.AppError)
return result, err
}
func (s *TimerLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.AppError) {
func (s *TimerLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.AnalyticsGetInactiveUsersCount()
@@ -7287,7 +7287,7 @@ func (s *TimerLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.Ap
return result, err
}
func (s *TimerLayerUserStore) AnalyticsGetSystemAdminCount() (int64, *model.AppError) {
func (s *TimerLayerUserStore) AnalyticsGetSystemAdminCount() (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.AnalyticsGetSystemAdminCount()
@@ -7303,7 +7303,7 @@ func (s *TimerLayerUserStore) AnalyticsGetSystemAdminCount() (int64, *model.AppE
return result, err
}
func (s *TimerLayerUserStore) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) {
func (s *TimerLayerUserStore) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, error) {
start := timemodule.Now()
result, err := s.UserStore.AutocompleteUsersInChannel(teamId, channelId, term, options)
@@ -7319,7 +7319,7 @@ func (s *TimerLayerUserStore) AutocompleteUsersInChannel(teamId string, channelI
return result, err
}
func (s *TimerLayerUserStore) ClearAllCustomRoleAssignments() *model.AppError {
func (s *TimerLayerUserStore) ClearAllCustomRoleAssignments() error {
start := timemodule.Now()
err := s.UserStore.ClearAllCustomRoleAssignments()
@@ -7350,7 +7350,7 @@ func (s *TimerLayerUserStore) ClearCaches() {
}
}
func (s *TimerLayerUserStore) Count(options model.UserCountOptions) (int64, *model.AppError) {
func (s *TimerLayerUserStore) Count(options model.UserCountOptions) (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.Count(options)
@@ -7366,7 +7366,7 @@ func (s *TimerLayerUserStore) Count(options model.UserCountOptions) (int64, *mod
return result, err
}
func (s *TimerLayerUserStore) DeactivateGuests() ([]string, *model.AppError) {
func (s *TimerLayerUserStore) DeactivateGuests() ([]string, error) {
start := timemodule.Now()
result, err := s.UserStore.DeactivateGuests()
@@ -7382,7 +7382,7 @@ func (s *TimerLayerUserStore) DeactivateGuests() ([]string, *model.AppError) {
return result, err
}
func (s *TimerLayerUserStore) DemoteUserToGuest(userID string) *model.AppError {
func (s *TimerLayerUserStore) DemoteUserToGuest(userID string) error {
start := timemodule.Now()
err := s.UserStore.DemoteUserToGuest(userID)
@@ -7398,7 +7398,7 @@ func (s *TimerLayerUserStore) DemoteUserToGuest(userID string) *model.AppError {
return err
}
func (s *TimerLayerUserStore) Get(id string) (*model.User, *model.AppError) {
func (s *TimerLayerUserStore) Get(id string) (*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.Get(id)
@@ -7414,7 +7414,7 @@ func (s *TimerLayerUserStore) Get(id string) (*model.User, *model.AppError) {
return result, err
}
func (s *TimerLayerUserStore) GetAll() ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetAll() ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAll()
@@ -7430,7 +7430,7 @@ func (s *TimerLayerUserStore) GetAll() ([]*model.User, *model.AppError) {
return result, err
}
func (s *TimerLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAllAfter(limit, afterId)
@@ -7446,7 +7446,7 @@ func (s *TimerLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.U
return result, err
}
func (s *TimerLayerUserStore) GetAllNotInAuthService(authServices []string) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetAllNotInAuthService(authServices []string) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAllNotInAuthService(authServices)
@@ -7462,7 +7462,7 @@ func (s *TimerLayerUserStore) GetAllNotInAuthService(authServices []string) ([]*
return result, err
}
func (s *TimerLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAllProfiles(options)
@@ -7478,7 +7478,7 @@ func (s *TimerLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*
return result, err
}
func (s *TimerLayerUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetAllProfilesInChannel(channelId string, allowFromCache bool) (map[string]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAllProfilesInChannel(channelId, allowFromCache)
@@ -7494,7 +7494,7 @@ func (s *TimerLayerUserStore) GetAllProfilesInChannel(channelId string, allowFro
return result, err
}
func (s *TimerLayerUserStore) GetAllUsingAuthService(authService string) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetAllUsingAuthService(authService string) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAllUsingAuthService(authService)
@@ -7510,7 +7510,7 @@ func (s *TimerLayerUserStore) GetAllUsingAuthService(authService string) ([]*mod
return result, err
}
func (s *TimerLayerUserStore) GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, *model.AppError) {
func (s *TimerLayerUserStore) GetAnyUnreadPostCountForChannel(userId string, channelId string) (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.GetAnyUnreadPostCountForChannel(userId, channelId)
@@ -7526,7 +7526,7 @@ func (s *TimerLayerUserStore) GetAnyUnreadPostCountForChannel(userId string, cha
return result, err
}
func (s *TimerLayerUserStore) GetByAuth(authData *string, authService string) (*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetByAuth(authData *string, authService string) (*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetByAuth(authData, authService)
@@ -7542,7 +7542,7 @@ func (s *TimerLayerUserStore) GetByAuth(authData *string, authService string) (*
return result, err
}
func (s *TimerLayerUserStore) GetByEmail(email string) (*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetByEmail(email string) (*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetByEmail(email)
@@ -7558,7 +7558,7 @@ func (s *TimerLayerUserStore) GetByEmail(email string) (*model.User, *model.AppE
return result, err
}
func (s *TimerLayerUserStore) GetByUsername(username string) (*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetByUsername(username string) (*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetByUsername(username)
@@ -7574,7 +7574,7 @@ func (s *TimerLayerUserStore) GetByUsername(username string) (*model.User, *mode
return result, err
}
func (s *TimerLayerUserStore) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetChannelGroupUsers(channelID string) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetChannelGroupUsers(channelID)
@@ -7638,7 +7638,7 @@ func (s *TimerLayerUserStore) GetEtagForProfilesNotInTeam(teamId string) string
return result
}
func (s *TimerLayerUserStore) GetForLogin(loginId string, allowSignInWithUsername bool, allowSignInWithEmail bool) (*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetForLogin(loginId string, allowSignInWithUsername bool, allowSignInWithEmail bool) (*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetForLogin(loginId, allowSignInWithUsername, allowSignInWithEmail)
@@ -7654,7 +7654,7 @@ func (s *TimerLayerUserStore) GetForLogin(loginId string, allowSignInWithUsernam
return result, err
}
func (s *TimerLayerUserStore) GetKnownUsers(userID string) ([]string, *model.AppError) {
func (s *TimerLayerUserStore) GetKnownUsers(userID string) ([]string, error) {
start := timemodule.Now()
result, err := s.UserStore.GetKnownUsers(userID)
@@ -7670,7 +7670,7 @@ func (s *TimerLayerUserStore) GetKnownUsers(userID string) ([]string, *model.App
return result, err
}
func (s *TimerLayerUserStore) GetNewUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetNewUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetNewUsersForTeam(teamId, offset, limit, viewRestrictions)
@@ -7686,7 +7686,7 @@ func (s *TimerLayerUserStore) GetNewUsersForTeam(teamId string, offset int, limi
return result, err
}
func (s *TimerLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string, channelIds []string) (map[string][]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfileByGroupChannelIdsForUser(userId, channelIds)
@@ -7702,7 +7702,7 @@ func (s *TimerLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string,
return result, err
}
func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfileByIds(userIds, options, allowFromCache)
@@ -7718,7 +7718,7 @@ func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *store.U
return result, err
}
func (s *TimerLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfiles(options)
@@ -7734,7 +7734,7 @@ func (s *TimerLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*mod
return result, err
}
func (s *TimerLayerUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfilesByUsernames(usernames, viewRestrictions)
@@ -7750,7 +7750,7 @@ func (s *TimerLayerUserStore) GetProfilesByUsernames(usernames []string, viewRes
return result, err
}
func (s *TimerLayerUserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfilesInChannel(options *model.UserGetOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfilesInChannel(options)
@@ -7766,7 +7766,7 @@ func (s *TimerLayerUserStore) GetProfilesInChannel(options *model.UserGetOptions
return result, err
}
func (s *TimerLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGetOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfilesInChannelByStatus(options)
@@ -7782,7 +7782,7 @@ func (s *TimerLayerUserStore) GetProfilesInChannelByStatus(options *model.UserGe
return result, err
}
func (s *TimerLayerUserStore) GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfilesNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfilesNotInChannel(teamId, channelId, groupConstrained, offset, limit, viewRestrictions)
@@ -7798,7 +7798,7 @@ func (s *TimerLayerUserStore) GetProfilesNotInChannel(teamId string, channelId s
return result, err
}
func (s *TimerLayerUserStore) GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfilesNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfilesNotInTeam(teamId, groupConstrained, offset, limit, viewRestrictions)
@@ -7814,7 +7814,7 @@ func (s *TimerLayerUserStore) GetProfilesNotInTeam(teamId string, groupConstrain
return result, err
}
func (s *TimerLayerUserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetProfilesWithoutTeam(options *model.UserGetOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetProfilesWithoutTeam(options)
@@ -7830,7 +7830,7 @@ func (s *TimerLayerUserStore) GetProfilesWithoutTeam(options *model.UserGetOptio
return result, err
}
func (s *TimerLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetRecentlyActiveUsersForTeam(teamId, offset, limit, viewRestrictions)
@@ -7846,7 +7846,7 @@ func (s *TimerLayerUserStore) GetRecentlyActiveUsersForTeam(teamId string, offse
return result, err
}
func (s *TimerLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetSystemAdminProfiles()
@@ -7862,7 +7862,7 @@ func (s *TimerLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User,
return result, err
}
func (s *TimerLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.GetTeamGroupUsers(teamID)
@@ -7878,7 +7878,7 @@ func (s *TimerLayerUserStore) GetTeamGroupUsers(teamID string) ([]*model.User, *
return result, err
}
func (s *TimerLayerUserStore) GetUnreadCount(userId string) (int64, *model.AppError) {
func (s *TimerLayerUserStore) GetUnreadCount(userId string) (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.GetUnreadCount(userId)
@@ -7894,7 +7894,7 @@ func (s *TimerLayerUserStore) GetUnreadCount(userId string) (int64, *model.AppEr
return result, err
}
func (s *TimerLayerUserStore) GetUnreadCountForChannel(userId string, channelId string) (int64, *model.AppError) {
func (s *TimerLayerUserStore) GetUnreadCountForChannel(userId string, channelId string) (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.GetUnreadCountForChannel(userId, channelId)
@@ -7910,7 +7910,7 @@ func (s *TimerLayerUserStore) GetUnreadCountForChannel(userId string, channelId
return result, err
}
func (s *TimerLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.UserForIndexing, *model.AppError) {
func (s *TimerLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.UserForIndexing, error) {
start := timemodule.Now()
result, err := s.UserStore.GetUsersBatchForIndexing(startTime, endTime, limit)
@@ -7926,7 +7926,7 @@ func (s *TimerLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime
return result, err
}
func (s *TimerLayerUserStore) InferSystemInstallDate() (int64, *model.AppError) {
func (s *TimerLayerUserStore) InferSystemInstallDate() (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.InferSystemInstallDate()
@@ -7987,7 +7987,7 @@ func (s *TimerLayerUserStore) InvalidateProfilesInChannelCacheByUser(userId stri
}
}
func (s *TimerLayerUserStore) PermanentDelete(userId string) *model.AppError {
func (s *TimerLayerUserStore) PermanentDelete(userId string) error {
start := timemodule.Now()
err := s.UserStore.PermanentDelete(userId)
@@ -8003,7 +8003,7 @@ func (s *TimerLayerUserStore) PermanentDelete(userId string) *model.AppError {
return err
}
func (s *TimerLayerUserStore) PromoteGuestToUser(userID string) *model.AppError {
func (s *TimerLayerUserStore) PromoteGuestToUser(userID string) error {
start := timemodule.Now()
err := s.UserStore.PromoteGuestToUser(userID)
@@ -8019,7 +8019,7 @@ func (s *TimerLayerUserStore) PromoteGuestToUser(userID string) *model.AppError
return err
}
func (s *TimerLayerUserStore) ResetLastPictureUpdate(userId string) *model.AppError {
func (s *TimerLayerUserStore) ResetLastPictureUpdate(userId string) error {
start := timemodule.Now()
err := s.UserStore.ResetLastPictureUpdate(userId)
@@ -8035,7 +8035,7 @@ func (s *TimerLayerUserStore) ResetLastPictureUpdate(userId string) *model.AppEr
return err
}
func (s *TimerLayerUserStore) Save(user *model.User) (*model.User, *model.AppError) {
func (s *TimerLayerUserStore) Save(user *model.User) (*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.Save(user)
@@ -8051,7 +8051,7 @@ func (s *TimerLayerUserStore) Save(user *model.User) (*model.User, *model.AppErr
return result, err
}
func (s *TimerLayerUserStore) Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) Search(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.Search(teamId, term, options)
@@ -8067,7 +8067,7 @@ func (s *TimerLayerUserStore) Search(teamId string, term string, options *model.
return result, err
}
func (s *TimerLayerUserStore) SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) SearchInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.SearchInChannel(channelId, term, options)
@@ -8083,7 +8083,7 @@ func (s *TimerLayerUserStore) SearchInChannel(channelId string, term string, opt
return result, err
}
func (s *TimerLayerUserStore) SearchInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) SearchInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.SearchInGroup(groupID, term, options)
@@ -8099,7 +8099,7 @@ func (s *TimerLayerUserStore) SearchInGroup(groupID string, term string, options
return result, err
}
func (s *TimerLayerUserStore) SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) SearchNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.SearchNotInChannel(teamId, channelId, term, options)
@@ -8115,7 +8115,7 @@ func (s *TimerLayerUserStore) SearchNotInChannel(teamId string, channelId string
return result, err
}
func (s *TimerLayerUserStore) SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) SearchNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.SearchNotInTeam(notInTeamId, term, options)
@@ -8131,7 +8131,7 @@ func (s *TimerLayerUserStore) SearchNotInTeam(notInTeamId string, term string, o
return result, err
}
func (s *TimerLayerUserStore) SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
func (s *TimerLayerUserStore) SearchWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, error) {
start := timemodule.Now()
result, err := s.UserStore.SearchWithoutTeam(term, options)
@@ -8147,7 +8147,7 @@ func (s *TimerLayerUserStore) SearchWithoutTeam(term string, options *model.User
return result, err
}
func (s *TimerLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, *model.AppError) {
func (s *TimerLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, error) {
start := timemodule.Now()
result, err := s.UserStore.Update(user, allowRoleUpdate)
@@ -8163,7 +8163,7 @@ func (s *TimerLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*m
return result, err
}
func (s *TimerLayerUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, *model.AppError) {
func (s *TimerLayerUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, error) {
start := timemodule.Now()
result, err := s.UserStore.UpdateAuthData(userId, service, authData, email, resetMfa)
@@ -8179,7 +8179,7 @@ func (s *TimerLayerUserStore) UpdateAuthData(userId string, service string, auth
return result, err
}
func (s *TimerLayerUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) *model.AppError {
func (s *TimerLayerUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) error {
start := timemodule.Now()
err := s.UserStore.UpdateFailedPasswordAttempts(userId, attempts)
@@ -8195,7 +8195,7 @@ func (s *TimerLayerUserStore) UpdateFailedPasswordAttempts(userId string, attemp
return err
}
func (s *TimerLayerUserStore) UpdateLastPictureUpdate(userId string) *model.AppError {
func (s *TimerLayerUserStore) UpdateLastPictureUpdate(userId string) error {
start := timemodule.Now()
err := s.UserStore.UpdateLastPictureUpdate(userId)
@@ -8211,7 +8211,7 @@ func (s *TimerLayerUserStore) UpdateLastPictureUpdate(userId string) *model.AppE
return err
}
func (s *TimerLayerUserStore) UpdateMfaActive(userId string, active bool) *model.AppError {
func (s *TimerLayerUserStore) UpdateMfaActive(userId string, active bool) error {
start := timemodule.Now()
err := s.UserStore.UpdateMfaActive(userId, active)
@@ -8227,7 +8227,7 @@ func (s *TimerLayerUserStore) UpdateMfaActive(userId string, active bool) *model
return err
}
func (s *TimerLayerUserStore) UpdateMfaSecret(userId string, secret string) *model.AppError {
func (s *TimerLayerUserStore) UpdateMfaSecret(userId string, secret string) error {
start := timemodule.Now()
err := s.UserStore.UpdateMfaSecret(userId, secret)
@@ -8243,7 +8243,7 @@ func (s *TimerLayerUserStore) UpdateMfaSecret(userId string, secret string) *mod
return err
}
func (s *TimerLayerUserStore) UpdatePassword(userId string, newPassword string) *model.AppError {
func (s *TimerLayerUserStore) UpdatePassword(userId string, newPassword string) error {
start := timemodule.Now()
err := s.UserStore.UpdatePassword(userId, newPassword)
@@ -8259,7 +8259,7 @@ func (s *TimerLayerUserStore) UpdatePassword(userId string, newPassword string)
return err
}
func (s *TimerLayerUserStore) UpdateUpdateAt(userId string) (int64, *model.AppError) {
func (s *TimerLayerUserStore) UpdateUpdateAt(userId string) (int64, error) {
start := timemodule.Now()
result, err := s.UserStore.UpdateUpdateAt(userId)
@@ -8275,7 +8275,7 @@ func (s *TimerLayerUserStore) UpdateUpdateAt(userId string) (int64, *model.AppEr
return result, err
}
func (s *TimerLayerUserStore) VerifyEmail(userId string, email string) (string, *model.AppError) {
func (s *TimerLayerUserStore) VerifyEmail(userId string, email string) (string, error) {
start := timemodule.Now()
result, err := s.UserStore.VerifyEmail(userId, email)