diff --git a/webapp/channels/src/actions/new_post.ts b/webapp/channels/src/actions/new_post.ts index 4b2d31c92a..68dc631261 100644 --- a/webapp/channels/src/actions/new_post.ts +++ b/webapp/channels/src/actions/new_post.ts @@ -49,6 +49,9 @@ export function completePostReceive(post: Post, websocketMessageProps: NewPostMe const result = await dispatch(PostActions.getPostThread(post.root_id)); if ('error' in result) { + if (websocketMessageProps.should_ack) { + WebSocketClient.acknowledgePostedNotification(post.id, 'error', 'missing_root_post', result.error); + } return {error: result.error}; } } diff --git a/webapp/channels/src/actions/websocket_actions.jsx b/webapp/channels/src/actions/websocket_actions.jsx index 877c8bbad0..8184cf178b 100644 --- a/webapp/channels/src/actions/websocket_actions.jsx +++ b/webapp/channels/src/actions/websocket_actions.jsx @@ -733,6 +733,12 @@ export function handleNewPostEvents(queue) { console.log('handleNewPostEvents - new posts received', posts); } + posts.forEach((post, index) => { + if (queue[index].data.should_ack) { + WebSocketClient.acknowledgePostedNotification(post.id, 'not_sent', 'too_many_posts'); + } + }); + // Receive the posts as one continuous block since they were received within a short period const crtEnabled = isCollapsedThreadsEnabled(myGetState()); const actions = posts.map((post) => receivedNewPost(post, crtEnabled));