From b8d4bddacf84ce1a3ce5b490c7a3e27add6e3abc Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Wed, 11 Sep 2024 16:49:51 +0530 Subject: [PATCH] echo: Fix handling of `locally_echoed` flag after successful msg resend. The `on_success` function within `echo.resend_message` is executed when the server successfully acknowledges a resent message. In this scenario, the `locally_echoed` flag should be set to false, as the message has been confirmed by the server. This behavior is already correctly handled within the `echo.reify_message_id()` function, which is triggered through the `compose.send_message_success()` flow. However, the on_success function incorrectly sets the `locally_echoed` flag to true, which is unnecessary and likely a mistake. This led to the bug where message controls would disappear from the resent messages on slow networks. This commit removes the erroneous line to ensure proper flag handling during message resend. --- web/src/echo.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/web/src/echo.ts b/web/src/echo.ts index cf668f82a3..95e95b0521 100644 --- a/web/src/echo.ts +++ b/web/src/echo.ts @@ -171,7 +171,6 @@ function resend_message( function on_success(raw_data: unknown): void { const data = send_message_api_response_schema.parse(raw_data); const message_id = data.id; - message.locally_echoed = true; hide_retry_spinner($row);