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.
This commit is contained in:
Sayam Samal 2024-09-11 16:49:51 +05:30 committed by Tim Abbott
parent 5583ddd3bf
commit b8d4bddacf
1 changed files with 0 additions and 1 deletions

View File

@ -171,7 +171,6 @@ function resend_message(
function on_success(raw_data: unknown): void { function on_success(raw_data: unknown): void {
const data = send_message_api_response_schema.parse(raw_data); const data = send_message_api_response_schema.parse(raw_data);
const message_id = data.id; const message_id = data.id;
message.locally_echoed = true;
hide_retry_spinner($row); hide_retry_spinner($row);