MM-15354: Migrate Channel.Save to sync by default (#10871)
* MM-15354: Migrate Channel.Save() to sync by default * MM-15354: fix unchanged Channel().Save() methods * fix typo * fix nil reference bug and update tests for channels * fix err shadowing bug * MM-15354 fix support for sync version of Save
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
d28f56c61e
Коммит
ff0d3ab00b
@@ -401,9 +401,8 @@ func TestGetChannelsForScheme(t *testing.T) {
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
|
||||
result1 := <-th.App.Srv.Store.Channel().Save(channel1, 1000000)
|
||||
assert.Nil(t, result1.Err)
|
||||
channel1 = result1.Data.(*model.Channel)
|
||||
channel1, errCh := th.App.Srv.Store.Channel().Save(channel1, 1000000)
|
||||
assert.Nil(t, errCh)
|
||||
|
||||
l2, r2 := th.SystemAdminClient.GetChannelsForScheme(scheme1.Id, 0, 100)
|
||||
CheckNoError(t, r2)
|
||||
@@ -425,9 +424,8 @@ func TestGetChannelsForScheme(t *testing.T) {
|
||||
Type: model.CHANNEL_OPEN,
|
||||
SchemeId: &scheme1.Id,
|
||||
}
|
||||
result3 := <-th.App.Srv.Store.Channel().Save(channel2, 1000000)
|
||||
assert.Nil(t, result3.Err)
|
||||
channel2 = result3.Data.(*model.Channel)
|
||||
channel2, err = th.App.Srv.Store.Channel().Save(channel2, 1000000)
|
||||
assert.Nil(t, err)
|
||||
|
||||
l4, r4 := th.SystemAdminClient.GetChannelsForScheme(scheme1.Id, 0, 100)
|
||||
CheckNoError(t, r4)
|
||||
@@ -691,15 +689,14 @@ func TestDeleteScheme(t *testing.T) {
|
||||
assert.Zero(t, role6.DeleteAt)
|
||||
|
||||
// Make sure this scheme is in use by a team.
|
||||
res := <-th.App.Srv.Store.Channel().Save(&model.Channel{
|
||||
channel, err := th.App.Srv.Store.Channel().Save(&model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: model.NewId(),
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
SchemeId: &s1.Id,
|
||||
}, -1)
|
||||
assert.Nil(t, res.Err)
|
||||
channel := res.Data.(*model.Channel)
|
||||
assert.Nil(t, err)
|
||||
|
||||
// Delete the Scheme.
|
||||
_, r3 := th.SystemAdminClient.DeleteScheme(s1.Id)
|
||||
|
||||
@@ -221,13 +221,11 @@ func (a *App) RenameChannel(channel *model.Channel, newChannelName string, newDi
|
||||
}
|
||||
|
||||
func (a *App) CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError) {
|
||||
result := <-a.Srv.Store.Channel().Save(channel, *a.Config().TeamSettings.MaxChannelsPerTeam)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
sc, err := a.Srv.Store.Channel().Save(channel, *a.Config().TeamSettings.MaxChannelsPerTeam)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sc := result.Data.(*model.Channel)
|
||||
|
||||
if addMember {
|
||||
user, err := a.Srv.Store.User().Get(channel.CreatorId)
|
||||
if err != nil {
|
||||
@@ -456,14 +454,13 @@ func (a *App) createGroupChannel(userIds []string, creatorId string) (*model.Cha
|
||||
Type: model.CHANNEL_GROUP,
|
||||
}
|
||||
|
||||
result = <-a.Srv.Store.Channel().Save(group, *a.Config().TeamSettings.MaxChannelsPerTeam)
|
||||
if result.Err != nil {
|
||||
if result.Err.Id == store.CHANNEL_EXISTS_ERROR {
|
||||
return result.Data.(*model.Channel), result.Err
|
||||
channel, err := a.Srv.Store.Channel().Save(group, *a.Config().TeamSettings.MaxChannelsPerTeam)
|
||||
if err != nil {
|
||||
if err.Id == store.CHANNEL_EXISTS_ERROR {
|
||||
return channel, err
|
||||
}
|
||||
return nil, result.Err
|
||||
return nil, err
|
||||
}
|
||||
channel := result.Data.(*model.Channel)
|
||||
|
||||
for _, user := range users {
|
||||
cm := &model.ChannelMember{
|
||||
|
||||
@@ -786,11 +786,10 @@ func (a *App) OldImportUser(team *model.Team, user *model.User) *model.User {
|
||||
}
|
||||
|
||||
func (a *App) OldImportChannel(channel *model.Channel) *model.Channel {
|
||||
result := <-a.Srv.Store.Channel().Save(channel, *a.Config().TeamSettings.MaxChannelsPerTeam)
|
||||
if result.Err != nil {
|
||||
sc, err := a.Srv.Store.Channel().Save(channel, *a.Config().TeamSettings.MaxChannelsPerTeam)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
sc := result.Data.(*model.Channel)
|
||||
|
||||
return sc
|
||||
}
|
||||
|
||||
@@ -450,41 +450,44 @@ func (s SqlChannelStore) upsertPublicChannelT(transaction *gorp.Transaction, cha
|
||||
}
|
||||
|
||||
// Save writes the (non-direct) channel channel to the database.
|
||||
func (s SqlChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
if channel.DeleteAt != 0 {
|
||||
result.Err = model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.archived_channel.app_error", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
func (s SqlChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) (*model.Channel, *model.AppError) {
|
||||
|
||||
if channel.Type == model.CHANNEL_DIRECT {
|
||||
result.Err = model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.direct_channel.app_error", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if channel.DeleteAt != 0 {
|
||||
return nil, model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.archived_channel.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
transaction, err := s.GetMaster().Begin()
|
||||
if err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.open_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
defer finalizeTransaction(transaction)
|
||||
if channel.Type == model.CHANNEL_DIRECT {
|
||||
return nil, model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.direct_channel.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
*result = s.saveChannelT(transaction, channel, maxChannelsPerTeam)
|
||||
if result.Err != nil {
|
||||
return
|
||||
}
|
||||
transaction, err := s.GetMaster().Begin()
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.open_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
defer finalizeTransaction(transaction)
|
||||
|
||||
// Additionally propagate the write to the PublicChannels table.
|
||||
if err := s.upsertPublicChannelT(transaction, result.Data.(*model.Channel)); err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.upsert_public_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
channelResult := s.saveChannelT(transaction, channel, maxChannelsPerTeam)
|
||||
var newChannel *model.Channel
|
||||
if channelResult.Data != nil {
|
||||
newChannel = channelResult.Data.(*model.Channel)
|
||||
}
|
||||
appErr := channelResult.Err
|
||||
|
||||
if err := transaction.Commit(); err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.commit_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
})
|
||||
if appErr != nil {
|
||||
return newChannel, appErr
|
||||
}
|
||||
|
||||
// Additionally propagate the write to the PublicChannels table.
|
||||
if err := s.upsertPublicChannelT(transaction, newChannel); err != nil {
|
||||
return nil, model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.upsert_public_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
|
||||
}
|
||||
|
||||
if err := transaction.Commit(); err != nil {
|
||||
return nil, model.NewAppError("SqlChannelStore.Save", "store.sql_channel.save.commit_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return newChannel, nil
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) CreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError) {
|
||||
|
||||
@@ -129,7 +129,7 @@ type TeamStore interface {
|
||||
}
|
||||
|
||||
type ChannelStore interface {
|
||||
Save(channel *model.Channel, maxChannelsPerTeam int64) StoreChannel
|
||||
Save(channel *model.Channel, maxChannelsPerTeam int64) (*model.Channel, *model.AppError)
|
||||
CreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError)
|
||||
SaveDirectChannel(channel *model.Channel, member1 *model.ChannelMember, member2 *model.ChannelMember) (*model.Channel, *model.AppError)
|
||||
Update(channel *model.Channel) (*model.Channel, *model.AppError)
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/store"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestChannelMemberHistoryStore(t *testing.T, ss store.Store) {
|
||||
@@ -23,13 +24,14 @@ func TestChannelMemberHistoryStore(t *testing.T, ss store.Store) {
|
||||
|
||||
func testLogJoinEvent(t *testing.T, ss store.Store) {
|
||||
// create a test channel
|
||||
channel := model.Channel{
|
||||
ch := model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
channel = *store.Must(ss.Channel().Save(&channel, -1)).(*model.Channel)
|
||||
channel, err := ss.Channel().Save(&ch, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// and a test user
|
||||
user := model.User{
|
||||
@@ -46,13 +48,14 @@ func testLogJoinEvent(t *testing.T, ss store.Store) {
|
||||
|
||||
func testLogLeaveEvent(t *testing.T, ss store.Store) {
|
||||
// create a test channel
|
||||
channel := model.Channel{
|
||||
ch := model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
channel = *store.Must(ss.Channel().Save(&channel, -1)).(*model.Channel)
|
||||
channel, err := ss.Channel().Save(&ch, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// and a test user
|
||||
user := model.User{
|
||||
@@ -72,13 +75,14 @@ func testLogLeaveEvent(t *testing.T, ss store.Store) {
|
||||
|
||||
func testGetUsersInChannelAtChannelMemberHistory(t *testing.T, ss store.Store) {
|
||||
// create a test channel
|
||||
channel := model.Channel{
|
||||
ch := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
channel = *store.Must(ss.Channel().Save(&channel, -1)).(*model.Channel)
|
||||
channel, err := ss.Channel().Save(ch, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// and a test user
|
||||
user := model.User{
|
||||
@@ -155,13 +159,14 @@ func testGetUsersInChannelAtChannelMemberHistory(t *testing.T, ss store.Store) {
|
||||
|
||||
func testGetUsersInChannelAtChannelMembers(t *testing.T, ss store.Store) {
|
||||
// create a test channel
|
||||
channel := model.Channel{
|
||||
channel := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
channel = *store.Must(ss.Channel().Save(&channel, -1)).(*model.Channel)
|
||||
channel, err := ss.Channel().Save(channel, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// and a test user
|
||||
user := model.User{
|
||||
@@ -257,13 +262,14 @@ func testGetUsersInChannelAtChannelMembers(t *testing.T, ss store.Store) {
|
||||
|
||||
func testPermanentDeleteBatch(t *testing.T, ss store.Store) {
|
||||
// create a test channel
|
||||
channel := model.Channel{
|
||||
channel := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
DisplayName: "Display " + model.NewId(),
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
channel = *store.Must(ss.Channel().Save(&channel, -1)).(*model.Channel)
|
||||
channel, err := ss.Channel().Save(channel, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// and two test users
|
||||
user := model.User{
|
||||
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -90,7 +90,8 @@ func testComplianceExport(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel2"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = store.Must(ss.Channel().Save(c1, -1)).(*model.Channel)
|
||||
c1, err = ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
o1 := &model.Post{}
|
||||
o1.ChannelId = c1.Id
|
||||
@@ -190,7 +191,8 @@ func testComplianceExportDirectMessages(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel2"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = store.Must(ss.Channel().Save(c1, -1)).(*model.Channel)
|
||||
c1, err = ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
cDM, err := ss.Channel().CreateDirectChannel(u1.Id, u2.Id)
|
||||
require.Nil(t, err)
|
||||
@@ -284,7 +286,8 @@ func testMessageExportPublicChannel(t *testing.T, ss store.Store) {
|
||||
DisplayName: "Public Channel",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
channel = store.Must(ss.Channel().Save(channel, -1)).(*model.Channel)
|
||||
channel, err = ss.Channel().Save(channel, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// user1 posts twice in the public channel
|
||||
post1 := &model.Post{
|
||||
@@ -379,7 +382,8 @@ func testMessageExportPrivateChannel(t *testing.T, ss store.Store) {
|
||||
DisplayName: "Private Channel",
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}
|
||||
channel = store.Must(ss.Channel().Save(channel, -1)).(*model.Channel)
|
||||
channel, err = ss.Channel().Save(channel, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// user1 posts twice in the private channel
|
||||
post1 := &model.Post{
|
||||
@@ -559,7 +563,8 @@ func testMessageExportGroupMessageChannel(t *testing.T, ss store.Store) {
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_GROUP,
|
||||
}
|
||||
groupMessageChannel = store.Must(ss.Channel().Save(groupMessageChannel, -1)).(*model.Channel)
|
||||
groupMessageChannel, err = ss.Channel().Save(groupMessageChannel, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
// user1 posts in the GM
|
||||
post := &model.Post{
|
||||
|
||||
@@ -1090,9 +1090,8 @@ func testPendingAutoAddChannelMembers(t *testing.T, ss store.Store) {
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_OPEN, // Query does not look at type so this shouldn't matter.
|
||||
}
|
||||
res = <-ss.Channel().Save(channel, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channel = res.Data.(*model.Channel)
|
||||
channel, err := ss.Channel().Save(channel, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Create GroupChannel
|
||||
res = <-ss.Group().CreateGroupSyncable(model.NewGroupChannel(group.Id, channel.Id, true))
|
||||
@@ -1169,7 +1168,7 @@ func testPendingAutoAddChannelMembers(t *testing.T, ss store.Store) {
|
||||
require.Len(t, res.Data, 1)
|
||||
|
||||
// No result if Channel deleted
|
||||
err := ss.Channel().Delete(channel.Id, model.GetMillis())
|
||||
err = ss.Channel().Delete(channel.Id, model.GetMillis())
|
||||
require.Nil(t, err)
|
||||
res = <-ss.Group().ChannelMembersToAdd(0)
|
||||
require.Nil(t, res.Err)
|
||||
@@ -1456,9 +1455,8 @@ func pendingMemberRemovalsDataSetup(t *testing.T, ss store.Store) *removalsData
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
GroupConstrained: model.NewBool(true),
|
||||
}
|
||||
res = <-ss.Channel().Save(channelConstrained, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channelConstrained = res.Data.(*model.Channel)
|
||||
channelConstrained, err := ss.Channel().Save(channelConstrained, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
channelUnconstrained := &model.Channel{
|
||||
TeamId: model.NewId(),
|
||||
@@ -1466,9 +1464,8 @@ func pendingMemberRemovalsDataSetup(t *testing.T, ss store.Store) *removalsData
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}
|
||||
res = <-ss.Channel().Save(channelUnconstrained, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channelUnconstrained = res.Data.(*model.Channel)
|
||||
channelUnconstrained, err = ss.Channel().Save(channelUnconstrained, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
// create teams
|
||||
teamConstrained := &model.Team{
|
||||
@@ -1482,7 +1479,7 @@ func pendingMemberRemovalsDataSetup(t *testing.T, ss store.Store) *removalsData
|
||||
Type: model.TEAM_INVITE,
|
||||
GroupConstrained: model.NewBool(true),
|
||||
}
|
||||
teamConstrained, err := ss.Team().Save(teamConstrained)
|
||||
teamConstrained, err = ss.Team().Save(teamConstrained)
|
||||
require.Nil(t, err)
|
||||
|
||||
teamUnconstrained := &model.Team{
|
||||
@@ -1569,12 +1566,11 @@ func testGetGroupsByChannel(t *testing.T, ss store.Store) {
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
res := <-ss.Channel().Save(channel1, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channel1 = res.Data.(*model.Channel)
|
||||
channel1, err := ss.Channel().Save(channel1, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Create Groups 1 and 2
|
||||
res = <-ss.Group().Create(&model.Group{
|
||||
res := <-ss.Group().Create(&model.Group{
|
||||
Name: model.NewId(),
|
||||
DisplayName: "group-1",
|
||||
RemoteId: model.NewId(),
|
||||
@@ -1610,9 +1606,8 @@ func testGetGroupsByChannel(t *testing.T, ss store.Store) {
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
res = <-ss.Channel().Save(channel2, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channel2 = res.Data.(*model.Channel)
|
||||
channel2, err = ss.Channel().Save(channel2, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Create Group3
|
||||
res = <-ss.Group().Create(&model.Group{
|
||||
@@ -1981,12 +1976,11 @@ func testGetGroups(t *testing.T, ss store.Store) {
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}
|
||||
res := <-ss.Channel().Save(channel1, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channel1 = res.Data.(*model.Channel)
|
||||
channel1, err = ss.Channel().Save(channel1, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Create Groups 1 and 2
|
||||
res = <-ss.Group().Create(&model.Group{
|
||||
res := <-ss.Group().Create(&model.Group{
|
||||
Name: model.NewId(),
|
||||
DisplayName: "group-1",
|
||||
RemoteId: model.NewId(),
|
||||
@@ -2036,9 +2030,8 @@ func testGetGroups(t *testing.T, ss store.Store) {
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}
|
||||
res = <-ss.Channel().Save(channel2, 9999)
|
||||
require.Nil(t, res.Err)
|
||||
channel2 = res.Data.(*model.Channel)
|
||||
channel2, err = ss.Channel().Save(channel2, 9999)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Create Group3
|
||||
res = <-ss.Group().Create(&model.Group{
|
||||
|
||||
@@ -947,19 +947,28 @@ func (_m *ChannelStore) Restore(channelId string, time int64) *model.AppError {
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: channel, maxChannelsPerTeam
|
||||
func (_m *ChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) store.StoreChannel {
|
||||
func (_m *ChannelStore) Save(channel *model.Channel, maxChannelsPerTeam int64) (*model.Channel, *model.AppError) {
|
||||
ret := _m.Called(channel, maxChannelsPerTeam)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(*model.Channel, int64) store.StoreChannel); ok {
|
||||
var r0 *model.Channel
|
||||
if rf, ok := ret.Get(0).(func(*model.Channel, int64) *model.Channel); ok {
|
||||
r0 = rf(channel, maxChannelsPerTeam)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
r0 = ret.Get(0).(*model.Channel)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Channel, int64) *model.AppError); ok {
|
||||
r1 = rf(channel, maxChannelsPerTeam)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveDirectChannel provides a mock function with given fields: channel, member1, member2
|
||||
|
||||
@@ -70,8 +70,8 @@ func testPostStoreSave(t *testing.T, ss store.Store) {
|
||||
|
||||
func testPostStoreSaveChannelMsgCounts(t *testing.T, ss store.Store) {
|
||||
c1 := &model.Channel{Name: model.NewId(), DisplayName: "posttestchannel", Type: model.CHANNEL_OPEN}
|
||||
res := <-ss.Channel().Save(c1, 1000000)
|
||||
require.Nil(t, res.Err)
|
||||
_, err := ss.Channel().Save(c1, 1000000)
|
||||
require.Nil(t, err)
|
||||
|
||||
o1 := model.Post{}
|
||||
o1.ChannelId = c1.Id
|
||||
@@ -80,7 +80,7 @@ func testPostStoreSaveChannelMsgCounts(t *testing.T, ss store.Store) {
|
||||
|
||||
require.Nil(t, (<-ss.Post().Save(&o1)).Err)
|
||||
|
||||
c1, err := ss.Channel().Get(c1.Id, false)
|
||||
c1, err = ss.Channel().Get(c1.Id, false)
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, int64(1), c1.TotalMsgCount, "Message count should update by 1")
|
||||
|
||||
@@ -991,7 +991,7 @@ func testPostStoreSearch(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel1"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = (<-ss.Channel().Save(c1, -1)).Data.(*model.Channel)
|
||||
c1, _ = ss.Channel().Save(c1, -1)
|
||||
|
||||
m1 := model.ChannelMember{}
|
||||
m1.ChannelId = c1.Id
|
||||
@@ -1004,14 +1004,15 @@ func testPostStoreSearch(t *testing.T, ss store.Store) {
|
||||
c2.DisplayName = "Channel1"
|
||||
c2.Name = "zz" + model.NewId() + "b"
|
||||
c2.Type = model.CHANNEL_OPEN
|
||||
c2 = (<-ss.Channel().Save(c2, -1)).Data.(*model.Channel)
|
||||
c2, _ = ss.Channel().Save(c2, -1)
|
||||
|
||||
c3 := &model.Channel{}
|
||||
c3.TeamId = teamId
|
||||
c3.DisplayName = "Channel1"
|
||||
c3.Name = "zz" + model.NewId() + "b"
|
||||
c3.Type = model.CHANNEL_OPEN
|
||||
c3 = (<-ss.Channel().Save(c3, -1)).Data.(*model.Channel)
|
||||
c3, _ = ss.Channel().Save(c3, -1)
|
||||
|
||||
ss.Channel().Delete(c3.Id, model.GetMillis())
|
||||
|
||||
m3 := model.ChannelMember{}
|
||||
@@ -1198,7 +1199,8 @@ func testUserCountsWithPostsByDay(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel2"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = store.Must(ss.Channel().Save(c1, -1)).(*model.Channel)
|
||||
c1, err = ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
o1 := &model.Post{}
|
||||
o1.ChannelId = c1.Id
|
||||
@@ -1257,7 +1259,8 @@ func testPostCountsByDay(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel2"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = store.Must(ss.Channel().Save(c1, -1)).(*model.Channel)
|
||||
c1, err = ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
o1 := &model.Post{}
|
||||
o1.ChannelId = c1.Id
|
||||
@@ -1318,7 +1321,8 @@ func testPostStoreGetFlaggedPostsForTeam(t *testing.T, ss store.Store, s SqlSupp
|
||||
c1.DisplayName = "Channel1"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = store.Must(ss.Channel().Save(c1, -1)).(*model.Channel)
|
||||
c1, err := ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
o1 := &model.Post{}
|
||||
o1.ChannelId = c1.Id
|
||||
@@ -1364,7 +1368,7 @@ func testPostStoreGetFlaggedPostsForTeam(t *testing.T, ss store.Store, s SqlSupp
|
||||
m2.UserId = model.NewId()
|
||||
m2.NotifyProps = model.GetDefaultChannelNotifyProps()
|
||||
|
||||
c2, err := ss.Channel().SaveDirectChannel(c2, m1, m2)
|
||||
c2, err = ss.Channel().SaveDirectChannel(c2, m1, m2)
|
||||
require.Nil(t, err)
|
||||
|
||||
o5 := &model.Post{}
|
||||
@@ -1934,14 +1938,14 @@ func testPostStoreGetPostsBatchForIndexing(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel1"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
c1 = (<-ss.Channel().Save(c1, -1)).Data.(*model.Channel)
|
||||
c1, _ = ss.Channel().Save(c1, -1)
|
||||
|
||||
c2 := &model.Channel{}
|
||||
c2.TeamId = model.NewId()
|
||||
c2.DisplayName = "Channel2"
|
||||
c2.Name = "zz" + model.NewId() + "b"
|
||||
c2.Type = model.CHANNEL_OPEN
|
||||
c2 = (<-ss.Channel().Save(c2, -1)).Data.(*model.Channel)
|
||||
c2, _ = ss.Channel().Save(c2, -1)
|
||||
|
||||
o1 := &model.Post{}
|
||||
o1.ChannelId = c1.Id
|
||||
@@ -2078,7 +2082,8 @@ func testPostStoreGetParentsForExportAfter(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel1"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
store.Must(ss.Channel().Save(&c1, -1))
|
||||
_, err = ss.Channel().Save(&c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
u1 := model.User{}
|
||||
u1.Username = model.NewId()
|
||||
@@ -2125,7 +2130,8 @@ func testPostStoreGetRepliesForExport(t *testing.T, ss store.Store) {
|
||||
c1.DisplayName = "Channel1"
|
||||
c1.Name = "zz" + model.NewId() + "b"
|
||||
c1.Type = model.CHANNEL_OPEN
|
||||
store.Must(ss.Channel().Save(&c1, -1))
|
||||
_, err = ss.Channel().Save(&c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
u1 := model.User{}
|
||||
u1.Email = MakeEmail()
|
||||
|
||||
@@ -457,9 +457,8 @@ func testSchemeStoreDelete(t *testing.T, ss store.Store) {
|
||||
Type: model.CHANNEL_OPEN,
|
||||
SchemeId: &d5.Id,
|
||||
}
|
||||
cres5 := <-ss.Channel().Save(c5, -1)
|
||||
assert.Nil(t, cres5.Err)
|
||||
c5 = cres5.Data.(*model.Channel)
|
||||
c5, err = ss.Channel().Save(c5, -1)
|
||||
assert.Nil(t, err)
|
||||
|
||||
sres5 := <-ss.Scheme().Delete(d5.Id)
|
||||
assert.Nil(t, sres5.Err)
|
||||
|
||||
@@ -1213,9 +1213,12 @@ func testGetChannelUnreadsForAllTeams(t *testing.T, ss store.Store) {
|
||||
store.Must(ss.Team().SaveMember(m2, -1))
|
||||
|
||||
c1 := &model.Channel{TeamId: m1.TeamId, Name: model.NewId(), DisplayName: "Town Square", Type: model.CHANNEL_OPEN, TotalMsgCount: 100}
|
||||
store.Must(ss.Channel().Save(c1, -1))
|
||||
_, err := ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := &model.Channel{TeamId: m2.TeamId, Name: model.NewId(), DisplayName: "Town Square", Type: model.CHANNEL_OPEN, TotalMsgCount: 100}
|
||||
store.Must(ss.Channel().Save(c2, -1))
|
||||
_, err = ss.Channel().Save(c2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
cm1 := &model.ChannelMember{ChannelId: c1.Id, UserId: m1.UserId, NotifyProps: model.GetDefaultChannelNotifyProps(), MsgCount: 90}
|
||||
store.Must(ss.Channel().SaveMember(cm1))
|
||||
@@ -1276,9 +1279,12 @@ func testGetChannelUnreadsForTeam(t *testing.T, ss store.Store) {
|
||||
store.Must(ss.Team().SaveMember(m1, -1))
|
||||
|
||||
c1 := &model.Channel{TeamId: m1.TeamId, Name: model.NewId(), DisplayName: "Town Square", Type: model.CHANNEL_OPEN, TotalMsgCount: 100}
|
||||
store.Must(ss.Channel().Save(c1, -1))
|
||||
_, err := ss.Channel().Save(c1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := &model.Channel{TeamId: m1.TeamId, Name: model.NewId(), DisplayName: "Town Square", Type: model.CHANNEL_OPEN, TotalMsgCount: 100}
|
||||
store.Must(ss.Channel().Save(c2, -1))
|
||||
_, err = ss.Channel().Save(c2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
cm1 := &model.ChannelMember{ChannelId: c1.Id, UserId: m1.UserId, NotifyProps: model.GetDefaultChannelNotifyProps(), MsgCount: 90}
|
||||
store.Must(ss.Channel().SaveMember(cm1))
|
||||
|
||||
@@ -678,19 +678,23 @@ func testUserStoreGetProfilesInChannel(t *testing.T, ss store.Store) {
|
||||
u3.IsBot = true
|
||||
defer func() { store.Must(ss.Bot().PermanentDelete(u3.Id)) }()
|
||||
|
||||
c1 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch1 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in channel",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c1, err := ss.Channel().Save(ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch2 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in private",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c2, err := ss.Channel().Save(ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
store.Must(ss.Channel().SaveMember(&model.ChannelMember{
|
||||
ChannelId: c1.Id,
|
||||
@@ -766,19 +770,23 @@ func testUserStoreGetProfilesInChannelByStatus(t *testing.T, ss store.Store) {
|
||||
u3.IsBot = true
|
||||
defer func() { store.Must(ss.Bot().PermanentDelete(u3.Id)) }()
|
||||
|
||||
c1 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch1 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in channel",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c1, err := ss.Channel().Save(ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch2 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in private",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c2, err := ss.Channel().Save(ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
store.Must(ss.Channel().SaveMember(&model.ChannelMember{
|
||||
ChannelId: c1.Id,
|
||||
@@ -909,19 +917,23 @@ func testUserStoreGetAllProfilesInChannel(t *testing.T, ss store.Store) {
|
||||
u3.IsBot = true
|
||||
defer func() { store.Must(ss.Bot().PermanentDelete(u3.Id)) }()
|
||||
|
||||
c1 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch1 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in channel",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c1, err := ss.Channel().Save(ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch2 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in private",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c2, err := ss.Channel().Save(ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
store.Must(ss.Channel().SaveMember(&model.ChannelMember{
|
||||
ChannelId: c1.Id,
|
||||
@@ -1016,19 +1028,23 @@ func testUserStoreGetProfilesNotInChannel(t *testing.T, ss store.Store) {
|
||||
u3.IsBot = true
|
||||
defer func() { store.Must(ss.Bot().PermanentDelete(u3.Id)) }()
|
||||
|
||||
c1 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch1 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in channel",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c1, err := ss.Channel().Save(ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
ch2 := &model.Channel{
|
||||
TeamId: teamId,
|
||||
DisplayName: "Profiles in private",
|
||||
Name: "profiles-" + model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
c2, err := ss.Channel().Save(ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
t.Run("get team 1, channel 1, offset 0, limit 100", func(t *testing.T) {
|
||||
result := <-ss.User().GetProfilesNotInChannel(teamId, c1.Id, false, 0, 100, nil)
|
||||
@@ -1669,7 +1685,7 @@ func testUserUnreadCount(t *testing.T, ss store.Store) {
|
||||
defer func() { require.Nil(t, ss.User().PermanentDelete(u2.Id)) }()
|
||||
store.Must(ss.Team().SaveMember(&model.TeamMember{TeamId: teamId, UserId: u2.Id}, -1))
|
||||
|
||||
if err := (<-ss.Channel().Save(&c1, -1)).Err; err != nil {
|
||||
if _, err := ss.Channel().Save(&c1, -1); err != nil {
|
||||
t.Fatal("couldn't save item", err)
|
||||
}
|
||||
|
||||
@@ -2332,21 +2348,23 @@ func testUserStoreSearchNotInChannel(t *testing.T, ss store.Store) {
|
||||
u2.AuthData = nilAuthData
|
||||
u3.AuthData = nilAuthData
|
||||
|
||||
c1 := model.Channel{
|
||||
ch1 := model.Channel{
|
||||
TeamId: tid,
|
||||
DisplayName: "NameName",
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
c1 = *store.Must(ss.Channel().Save(&c1, -1)).(*model.Channel)
|
||||
c1, err := ss.Channel().Save(&ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := model.Channel{
|
||||
ch2 := model.Channel{
|
||||
TeamId: tid,
|
||||
DisplayName: "NameName",
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
c2 = *store.Must(ss.Channel().Save(&c2, -1)).(*model.Channel)
|
||||
c2, err := ss.Channel().Save(&ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
store.Must(ss.Channel().SaveMember(&model.ChannelMember{
|
||||
ChannelId: c2.Id,
|
||||
@@ -2546,21 +2564,23 @@ func testUserStoreSearchInChannel(t *testing.T, ss store.Store) {
|
||||
u2.AuthData = nilAuthData
|
||||
u3.AuthData = nilAuthData
|
||||
|
||||
c1 := model.Channel{
|
||||
ch1 := model.Channel{
|
||||
TeamId: tid,
|
||||
DisplayName: "NameName",
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
c1 = *store.Must(ss.Channel().Save(&c1, -1)).(*model.Channel)
|
||||
c1, err := ss.Channel().Save(&ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
c2 := model.Channel{
|
||||
ch2 := model.Channel{
|
||||
TeamId: tid,
|
||||
DisplayName: "NameName",
|
||||
Name: "zz" + model.NewId() + "b",
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}
|
||||
c2 = *store.Must(ss.Channel().Save(&c2, -1)).(*model.Channel)
|
||||
c2, err := ss.Channel().Save(&ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
store.Must(ss.Channel().SaveMember(&model.ChannelMember{
|
||||
ChannelId: c1.Id,
|
||||
@@ -3411,18 +3431,28 @@ func testUserStoreGetUsersBatchForIndexing(t *testing.T, ss store.Store) {
|
||||
Type: model.TEAM_OPEN,
|
||||
})
|
||||
require.Nil(t, err)
|
||||
cPub1 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
|
||||
ch1 := &model.Channel{
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}, -1)).(*model.Channel)
|
||||
cPub2 := store.Must(ss.Channel().Save(&model.Channel{
|
||||
}
|
||||
cPub1, err := ss.Channel().Save(ch1, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
ch2 := &model.Channel{
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_OPEN,
|
||||
}, -1)).(*model.Channel)
|
||||
cPriv := store.Must(ss.Channel().Save(&model.Channel{
|
||||
}
|
||||
cPub2, err := ss.Channel().Save(ch2, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
ch3 := &model.Channel{
|
||||
Name: model.NewId(),
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}, -1)).(*model.Channel)
|
||||
}
|
||||
|
||||
cPriv, err := ss.Channel().Save(ch3, -1)
|
||||
require.Nil(t, err)
|
||||
|
||||
u1 := store.Must(ss.User().Save(&model.User{
|
||||
Email: MakeEmail(),
|
||||
@@ -3649,20 +3679,19 @@ func testUserStoreGetTeamGroupUsers(t *testing.T, ss store.Store) {
|
||||
func testUserStoreGetChannelGroupUsers(t *testing.T, ss store.Store) {
|
||||
// create channel
|
||||
id := model.NewId()
|
||||
res := <-ss.Channel().Save(&model.Channel{
|
||||
channel, err := ss.Channel().Save(&model.Channel{
|
||||
DisplayName: "dn_" + id,
|
||||
Name: "n-" + id,
|
||||
Type: model.CHANNEL_PRIVATE,
|
||||
}, 999)
|
||||
require.Nil(t, res.Err)
|
||||
channel := res.Data.(*model.Channel)
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, channel)
|
||||
|
||||
// create users
|
||||
var testUsers []*model.User
|
||||
for i := 0; i < 3; i++ {
|
||||
id = model.NewId()
|
||||
res = <-ss.User().Save(&model.User{
|
||||
res := <-ss.User().Save(&model.User{
|
||||
Email: id + "@test.com",
|
||||
Username: "un_" + id,
|
||||
Nickname: "nn_" + id,
|
||||
@@ -3680,7 +3709,7 @@ func testUserStoreGetChannelGroupUsers(t *testing.T, ss store.Store) {
|
||||
userNoGroup := testUsers[2]
|
||||
|
||||
// add non-group-member to the channel (to prove that the query isn't just returning all members)
|
||||
res = <-ss.Channel().SaveMember(&model.ChannelMember{
|
||||
res := <-ss.Channel().SaveMember(&model.ChannelMember{
|
||||
ChannelId: channel.Id,
|
||||
UserId: userNoGroup.Id,
|
||||
NotifyProps: model.GetDefaultChannelNotifyProps(),
|
||||
@@ -3734,7 +3763,7 @@ func testUserStoreGetChannelGroupUsers(t *testing.T, ss store.Store) {
|
||||
|
||||
// update team to be group-constrained
|
||||
channel.GroupConstrained = model.NewBool(true)
|
||||
_, err := ss.Channel().Update(channel)
|
||||
_, err = ss.Channel().Update(channel)
|
||||
require.Nil(t, err)
|
||||
|
||||
// still returns user (being group-constrained has no effect)
|
||||
|
||||
Ссылка в новой задаче
Block a user