MM-59827: Remove user profile invalidations from channel APIs (#27720)

We were invalidating the userProfileByIds cache unnecessarily
when it wasn't really needed. It's just that the InvalidateCacheForUser
method wiped off all user related caches, when we just needed to wipe
user-channel related caches.

To fix this, we split the user cache invalidation method into two
and just call the InvalidateChannelCacheForUser method from app/channel.go.

https://mattermost.atlassian.net/browse/MM-59827
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-08-19 20:02:35 +05:30
коммит произвёл GitHub
родитель db626377bf
Коммит 3150900bd7
2 изменённых файлов: 14 добавлений и 10 удалений

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

@@ -196,11 +196,15 @@ func (ps *PlatformService) InvalidateCacheForChannelPosts(channelID string) {
}
func (ps *PlatformService) InvalidateCacheForUser(userID string) {
ps.InvalidateChannelCacheForUser(userID)
ps.Store.User().InvalidateProfileCacheForUser(userID)
}
func (ps *PlatformService) InvalidateChannelCacheForUser(userID string) {
ps.Store.Channel().InvalidateAllChannelMembersForUser(userID)
ps.ClearUserSessionCache(userID)
ps.Store.User().InvalidateProfilesInChannelCacheByUser(userID)
ps.Store.User().InvalidateProfileCacheForUser(userID)
}
func (ps *PlatformService) InvalidateCacheForUserTeams(userID string) {