[MM-58070] Ensure the batched post handler also send websocket acknowledgements (#26938)
* [MM-58070] Ensure the batched post handler also send websocket acknowledgements * Add ack for missing root post error --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3bd6c44413
Коммит
4db2ae5753
@@ -49,6 +49,9 @@ export function completePostReceive(post: Post, websocketMessageProps: NewPostMe
|
|||||||
const result = await dispatch(PostActions.getPostThread(post.root_id));
|
const result = await dispatch(PostActions.getPostThread(post.root_id));
|
||||||
|
|
||||||
if ('error' in result) {
|
if ('error' in result) {
|
||||||
|
if (websocketMessageProps.should_ack) {
|
||||||
|
WebSocketClient.acknowledgePostedNotification(post.id, 'error', 'missing_root_post', result.error);
|
||||||
|
}
|
||||||
return {error: result.error};
|
return {error: result.error};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -733,6 +733,12 @@ export function handleNewPostEvents(queue) {
|
|||||||
console.log('handleNewPostEvents - new posts received', posts);
|
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
|
// Receive the posts as one continuous block since they were received within a short period
|
||||||
const crtEnabled = isCollapsedThreadsEnabled(myGetState());
|
const crtEnabled = isCollapsedThreadsEnabled(myGetState());
|
||||||
const actions = posts.map((post) => receivedNewPost(post, crtEnabled));
|
const actions = posts.map((post) => receivedNewPost(post, crtEnabled));
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user