diff --git a/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.test.ts b/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.test.ts index 40d263a26c..e95822dbf9 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.test.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.test.ts @@ -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: [], diff --git a/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.ts b/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.ts index 0d490b1784..f4f2587a7c 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/reducers/entities/posts.ts @@ -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 = {}, 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; }