[MM-58355] Send invalidate cache message across the cluster so that websocket connections on other instances are invalidated correctly (#27204)

* [MM-58355] Send invalidate cache message across the cluster so that websocket connections on other instances are invalidated correctly

* Add suggestion to clear the session cache on the local node as well

* Force read from master DB when gettting channel members for websocket to avoid any DB sync issues

* PR feedback

* Missed generated files
Этот коммит содержится в:
Devin Binnie
2024-06-07 09:38:53 -04:00
коммит произвёл GitHub
родитель 91741a7fa4
Коммит f3e760008c
17 изменённых файлов: 55 добавлений и 57 удалений

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

@@ -534,9 +534,9 @@ func (_m *ChannelStore) GetAllChannelMemberIdsByChannelId(id string) ([]string,
return r0, r1
}
// GetAllChannelMembersForUser provides a mock function with given fields: userID, allowFromCache, includeDeleted
func (_m *ChannelStore) GetAllChannelMembersForUser(userID string, allowFromCache bool, includeDeleted bool) (map[string]string, error) {
ret := _m.Called(userID, allowFromCache, includeDeleted)
// GetAllChannelMembersForUser provides a mock function with given fields: ctx, userID, allowFromCache, includeDeleted
func (_m *ChannelStore) GetAllChannelMembersForUser(ctx request.CTX, userID string, allowFromCache bool, includeDeleted bool) (map[string]string, error) {
ret := _m.Called(ctx, userID, allowFromCache, includeDeleted)
if len(ret) == 0 {
panic("no return value specified for GetAllChannelMembersForUser")
@@ -544,19 +544,19 @@ func (_m *ChannelStore) GetAllChannelMembersForUser(userID string, allowFromCach
var r0 map[string]string
var r1 error
if rf, ok := ret.Get(0).(func(string, bool, bool) (map[string]string, error)); ok {
return rf(userID, allowFromCache, includeDeleted)
if rf, ok := ret.Get(0).(func(request.CTX, string, bool, bool) (map[string]string, error)); ok {
return rf(ctx, userID, allowFromCache, includeDeleted)
}
if rf, ok := ret.Get(0).(func(string, bool, bool) map[string]string); ok {
r0 = rf(userID, allowFromCache, includeDeleted)
if rf, ok := ret.Get(0).(func(request.CTX, string, bool, bool) map[string]string); ok {
r0 = rf(ctx, userID, allowFromCache, includeDeleted)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]string)
}
}
if rf, ok := ret.Get(1).(func(string, bool, bool) error); ok {
r1 = rf(userID, allowFromCache, includeDeleted)
if rf, ok := ret.Get(1).(func(request.CTX, string, bool, bool) error); ok {
r1 = rf(ctx, userID, allowFromCache, includeDeleted)
} else {
r1 = ret.Error(1)
}

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

@@ -479,9 +479,9 @@ func (_m *UserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.Use
return r0, r1
}
// GetAllProfilesInChannel provides a mock function with given fields: ctx, channelID, allowFromCache
func (_m *UserStore) GetAllProfilesInChannel(ctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
ret := _m.Called(ctx, channelID, allowFromCache)
// GetAllProfilesInChannel provides a mock function with given fields: rctx, channelID, allowFromCache
func (_m *UserStore) GetAllProfilesInChannel(rctx context.Context, channelID string, allowFromCache bool) (map[string]*model.User, error) {
ret := _m.Called(rctx, channelID, allowFromCache)
if len(ret) == 0 {
panic("no return value specified for GetAllProfilesInChannel")
@@ -490,10 +490,10 @@ func (_m *UserStore) GetAllProfilesInChannel(ctx context.Context, channelID stri
var r0 map[string]*model.User
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, bool) (map[string]*model.User, error)); ok {
return rf(ctx, channelID, allowFromCache)
return rf(rctx, channelID, allowFromCache)
}
if rf, ok := ret.Get(0).(func(context.Context, string, bool) map[string]*model.User); ok {
r0 = rf(ctx, channelID, allowFromCache)
r0 = rf(rctx, channelID, allowFromCache)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]*model.User)
@@ -501,7 +501,7 @@ func (_m *UserStore) GetAllProfilesInChannel(ctx context.Context, channelID stri
}
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
r1 = rf(ctx, channelID, allowFromCache)
r1 = rf(rctx, channelID, allowFromCache)
} else {
r1 = ret.Error(1)
}