[MM-25314] Migrate AppError from channel_member_history_store.go (#14693)

* Migrate AppError from channel_member_history_store

* Migrate AppError from channel_member_history_store

* Migrate AppError from channel_member_history_store

* Migrate AppError from channel_member_history_store

* Migrating error keys

* Review fixes.

* Regenerating i18n

* Add some i18n strings

Co-authored-by: Dante Pippi <6619666+dantepippi@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2020-06-04 13:08:51 +05:30
коммит произвёл GitHub
родитель 3649d04dfa
Коммит 21b753b38d
10 изменённых файлов: 104 добавлений и 104 удалений

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

@@ -154,8 +154,8 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordTownSquare(t *testi
channel, err := th.App.Srv().Store.Channel().GetByName(th.BasicTeam.Id, "town-square", true)
require.Nil(t, err)
townSquareChannelId := channel.Id
users, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, townSquareChannelId)
require.Nil(t, err)
users, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, townSquareChannelId)
require.Nil(t, nErr)
initialNumTownSquareUsers := len(users)
// create a new user that joins the default channels
@@ -163,8 +163,8 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordTownSquare(t *testi
th.App.JoinDefaultChannels(th.BasicTeam.Id, user, false, "")
// there should be a ChannelMemberHistory record for the user
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, townSquareChannelId)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, townSquareChannelId)
require.Nil(t, nErr)
assert.Len(t, histories, initialNumTownSquareUsers+1)
found := false
@@ -185,8 +185,8 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordOffTopic(t *testing
channel, err := th.App.Srv().Store.Channel().GetByName(th.BasicTeam.Id, "off-topic", true)
require.Nil(t, err)
offTopicChannelId := channel.Id
users, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, offTopicChannelId)
require.Nil(t, err)
users, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, offTopicChannelId)
require.Nil(t, nErr)
initialNumTownSquareUsers := len(users)
// create a new user that joins the default channels
@@ -194,8 +194,8 @@ func TestJoinDefaultChannelsCreatesChannelMemberHistoryRecordOffTopic(t *testing
th.App.JoinDefaultChannels(th.BasicTeam.Id, user, false, "")
// there should be a ChannelMemberHistory record for the user
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, offTopicChannelId)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, offTopicChannelId)
require.Nil(t, nErr)
assert.Len(t, histories, initialNumTownSquareUsers+1)
found := false
@@ -298,8 +298,8 @@ func TestCreateGroupChannelCreatesChannelMemberHistoryRecord(t *testing.T) {
channel, err := th.App.CreateGroupChannel(groupUserIds, th.BasicUser.Id)
require.Nil(t, err, "Failed to create group channel.")
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, nErr)
assert.Len(t, histories, 3)
channelMemberHistoryUserIds := make([]string, 0)
@@ -323,8 +323,8 @@ func TestCreateDirectChannelCreatesChannelMemberHistoryRecord(t *testing.T) {
channel, err := th.App.GetOrCreateDirectChannel(user1.Id, user2.Id)
require.Nil(t, err, "Failed to create direct channel.")
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, nErr)
assert.Len(t, histories, 2)
historyId0 := histories[0].UserId
@@ -351,8 +351,8 @@ func TestGetDirectChannelCreatesChannelMemberHistoryRecord(t *testing.T) {
require.Nil(t, err, "Failed to create direct channel.")
// there should be a ChannelMemberHistory record for both users
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, nErr)
assert.Len(t, histories, 2)
historyId0 := histories[0].UserId
@@ -386,8 +386,8 @@ func TestAddUserToChannelCreatesChannelMemberHistoryRecord(t *testing.T) {
require.Nil(t, err, "Failed to add user to channel.")
// there should be a ChannelMemberHistory record for the user
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, nErr)
assert.Len(t, histories, 2)
channelMemberHistoryUserIds := make([]string, 0)
for _, history := range histories {
@@ -474,8 +474,8 @@ func TestAddChannelMemberNoUserRequestor(t *testing.T) {
require.Nil(t, err, "Failed to add user to channel.")
// there should be a ChannelMemberHistory record for the user
histories, err := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, err)
histories, nErr := th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, channel.Id)
require.Nil(t, nErr)
assert.Len(t, histories, 2)
channelMemberHistoryUserIds := make([]string, 0)
for _, history := range histories {