From bdbe8f990c137e14f73802313c467eab1cc2437d Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 15 Jul 2018 12:29:28 +0300 Subject: [PATCH] Add more debug. GitOrigin-RevId: cfc7b2526233caa5beb2a1ed3d145224354ba3ae --- td/telegram/MessagesManager.cpp | 18 ++++++++++++++---- td/telegram/MessagesManager.h | 5 +++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index b71d8fe1f..5c96336a0 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -7330,6 +7330,7 @@ void MessagesManager::on_get_history(DialogId dialog_id, MessageId from_message_ } } + bool prev_have_full_history = false; MessageId prev_last_new_message_id; MessageId prev_first_database_message_id; MessageId prev_last_database_message_id; @@ -7339,6 +7340,7 @@ void MessagesManager::on_get_history(DialogId dialog_id, MessageId from_message_ prev_first_database_message_id = d->first_database_message_id; prev_last_database_message_id = d->last_database_message_id; prev_last_message_id = d->last_message_id; + prev_have_full_history = d->have_full_history; } for (auto &message : messages) { @@ -7436,8 +7438,11 @@ void MessagesManager::on_get_history(DialogId dialog_id, MessageId from_message_ CHECK(d->last_new_message_id.is_valid()) << dialog_id << " " << from_the_end << " " << d->first_database_message_id << " " << d->last_database_message_id << " " << first_added_message_id << " " << last_added_message_id << " " - << d->last_message_id << " " << d->last_new_message_id << " " << prev_last_new_message_id << " " - << prev_first_database_message_id << " " << prev_last_database_message_id << " " << prev_last_message_id; + << d->last_message_id << " " << d->last_new_message_id << " " << d->have_full_history << " " + << prev_last_new_message_id << " " << prev_first_database_message_id << " " << prev_last_database_message_id + << " " << prev_last_message_id << " " << prev_have_full_history << " " << d->debug_last_new_message_id << " " + << d->debug_first_database_message_id << " " << d->debug_last_database_message_id; + CHECK(d->first_database_message_id.is_valid()); { MessagesConstIterator it(d, d->first_database_message_id); @@ -7472,8 +7477,10 @@ void MessagesManager::on_get_history(DialogId dialog_id, MessageId from_message_ CHECK(d->first_database_message_id.is_valid()) << dialog_id << " " << from_the_end << " " << d->first_database_message_id << " " << d->last_database_message_id << " " << first_added_message_id << " " << last_added_message_id << " " << d->last_message_id << " " - << d->last_new_message_id << " " << prev_last_new_message_id << " " << prev_first_database_message_id << " " - << prev_last_database_message_id << " " << prev_last_message_id; + << d->last_new_message_id << " " << d->have_full_history << " " << prev_last_new_message_id << " " + << prev_first_database_message_id << " " << prev_last_database_message_id << " " << prev_last_message_id << " " + << prev_have_full_history << " " << d->debug_last_new_message_id << " " << d->debug_first_database_message_id + << " " << d->debug_last_database_message_id; CHECK(d->last_database_message_id.is_valid()); for (auto &first_message_id : d->first_database_message_id_by_index) { @@ -24863,6 +24870,9 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr &&last_datab set_dialog_first_database_message_id(d, MessageId(), "add_new_dialog 5"); } } + d->debug_first_database_message_id = d->first_database_message_id; + d->debug_last_database_message_id = d->last_database_message_id; + d->debug_last_new_message_id = d->last_new_message_id; if (last_database_message != nullptr) { int32 dependent_dialog_count = 0; diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index b7b500ff2..948ff6ed6 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -1698,6 +1698,11 @@ class MessagesManager : public Actor { const char *debug_set_dialog_last_database_message_id = "Unknown"; // to be removed soon vector debug_message_op; + // message identifiers loaded from database, to be removed soon + MessageId debug_last_new_message_id; + MessageId debug_first_database_message_id; + MessageId debug_last_database_message_id; + Dialog() = default; Dialog(const Dialog &) = delete; Dialog &operator=(const Dialog &) = delete;