debug: add logging for edit_message to diagnose 'Message not found' error

- Log chat_id, message_id, text length before calling edit_message_text
- Log success or exact TDLib error
- This will help identify the root cause

Temporary debug commit to investigate issue.
This commit is contained in:
Mikhail Kilin
2026-02-01 00:08:00 +03:00
parent 2b18d5a481
commit fe924faff4

View File

@@ -320,16 +320,24 @@ impl MessageManager {
clear_draft: true, clear_draft: true,
}); });
eprintln!("[EDIT] Calling edit_message_text: chat_id={}, message_id={}, text_len={}",
chat_id.as_i64(), message_id.as_i64(), text.len());
let result = let result =
functions::edit_message_text(chat_id.as_i64(), message_id.as_i64(), content, self.client_id).await; functions::edit_message_text(chat_id.as_i64(), message_id.as_i64(), content, self.client_id).await;
match result { match result {
Ok(tdlib_rs::enums::Message::Message(msg)) => self Ok(tdlib_rs::enums::Message::Message(msg)) => {
.convert_message(&msg) eprintln!("[EDIT] Success! Edited message ID: {}", msg.id);
.await self.convert_message(&msg)
.ok_or_else(|| "Не удалось конвертировать отредактированное сообщение".to_string()), .await
.ok_or_else(|| "Не удалось конвертировать отредактированное сообщение".to_string())
}
Ok(_) => Err("Неожиданный тип сообщения".to_string()), Ok(_) => Err("Неожиданный тип сообщения".to_string()),
Err(e) => Err(format!("Ошибка редактирования: {:?}", e)), Err(e) => {
eprintln!("[EDIT] Error from TDLib: {:?}", e);
Err(format!("Ошибка редактирования: {:?}", e))
}
} }
} }