- Ephemeral system answers from commands in threads are also posted in parent channel - Removed an obsolete condition that provoked the bug
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5fe7c36457
Коммит
dd258f5ee5
@@ -722,6 +722,23 @@ describe('postsInChannel', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should do nothing when a reply-post comes and CRT is ON, even if ephemeral', () => {
|
||||
const state = deepFreeze({
|
||||
channel1: [],
|
||||
});
|
||||
|
||||
const nextState = reducers.postsInChannel(state, {
|
||||
type: PostTypes.RECEIVED_NEW_POST,
|
||||
data: {id: 'post1', channel_id: 'channel1', root_id: 'parent1', type: 'system_ephemeral'},
|
||||
features: {crtEnabled: true},
|
||||
}, {}, {});
|
||||
|
||||
expect(nextState).toBe(state);
|
||||
expect(nextState).toEqual({
|
||||
channel1: [],
|
||||
});
|
||||
});
|
||||
|
||||
it('should reset when called for (e.g. when CRT is TOGGLED)', () => {
|
||||
const state = deepFreeze({
|
||||
channel1: [],
|
||||
|
||||
@@ -22,7 +22,6 @@ import type {
|
||||
import type {MMReduxAction} from 'mattermost-redux/action_types';
|
||||
import {ChannelTypes, PostTypes, UserTypes, ThreadTypes, CloudTypes} from 'mattermost-redux/action_types';
|
||||
import {Posts} from 'mattermost-redux/constants';
|
||||
import {PostTypes as PostConstant} from 'mattermost-redux/constants/posts';
|
||||
import {comparePosts, isPermalink, shouldUpdatePost} from 'mattermost-redux/utils/post_utils';
|
||||
|
||||
export function removeUnneededMetadata(post: Post) {
|
||||
@@ -472,7 +471,7 @@ export function postsInChannel(state: Record<string, PostOrderBlock[]> = {}, act
|
||||
case PostTypes.RECEIVED_NEW_POST: {
|
||||
const post = action.data as Post;
|
||||
|
||||
if (action.features?.crtEnabled && post.root_id && post.type !== PostConstant.EPHEMERAL) {
|
||||
if (action.features?.crtEnabled && post.root_id) {
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user