Improve log messages.
GitOrigin-RevId: 23d2e596dd9ce28d780fe125abd468fef132c61b
This commit is contained in:
parent
16c02c6b25
commit
12a79efbdc
@ -10589,7 +10589,7 @@ void ContactsManager::on_get_channel_participants_success(
|
|||||||
<< channel_id;
|
<< channel_id;
|
||||||
total_count = static_cast<int32>(result.size());
|
total_count = static_cast<int32>(result.size());
|
||||||
} else if (is_full && total_count > static_cast<int32>(result.size())) {
|
} else if (is_full && total_count > static_cast<int32>(result.size())) {
|
||||||
LOG(ERROR) << "Fix total member count from " << total_count << " to " << result.size();
|
LOG(ERROR) << "Fix total number of members from " << total_count << " to " << result.size() << " in " << channel_id;
|
||||||
total_count = static_cast<int32>(result.size());
|
total_count = static_cast<int32>(result.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11469,7 +11469,7 @@ void ContactsManager::on_update_chat_add_user(ChatId chat_id, UserId inviter_use
|
|||||||
// Chat is already updated
|
// Chat is already updated
|
||||||
if (chat_full->version == c->version &&
|
if (chat_full->version == c->version &&
|
||||||
narrow_cast<int32>(chat_full->participants.size()) != c->participant_count) {
|
narrow_cast<int32>(chat_full->participants.size()) != c->participant_count) {
|
||||||
LOG(ERROR) << "Number of members of " << chat_id << " with version " << c->version << " is "
|
LOG(ERROR) << "Number of members in " << chat_id << " with version " << c->version << " is "
|
||||||
<< c->participant_count << " but there are " << chat_full->participants.size()
|
<< c->participant_count << " but there are " << chat_full->participants.size()
|
||||||
<< " members in the ChatFull";
|
<< " members in the ChatFull";
|
||||||
repair_chat_participants(chat_id);
|
repair_chat_participants(chat_id);
|
||||||
@ -11743,7 +11743,7 @@ void ContactsManager::on_update_chat_participant_count(Chat *c, ChatId chat_id,
|
|||||||
|
|
||||||
if (version < c->version) {
|
if (version < c->version) {
|
||||||
// some outdated data
|
// some outdated data
|
||||||
LOG(INFO) << "Receive member count of " << chat_id << " with version " << version << debug_str
|
LOG(INFO) << "Receive number of members in " << chat_id << " with version " << version << debug_str
|
||||||
<< ", but current version is " << c->version;
|
<< ", but current version is " << c->version;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -11752,7 +11752,7 @@ void ContactsManager::on_update_chat_participant_count(Chat *c, ChatId chat_id,
|
|||||||
if (version == c->version && participant_count != 0) {
|
if (version == c->version && participant_count != 0) {
|
||||||
// version is not changed when deleted user is removed from the chat
|
// version is not changed when deleted user is removed from the chat
|
||||||
LOG_IF(ERROR, c->participant_count != participant_count + 1)
|
LOG_IF(ERROR, c->participant_count != participant_count + 1)
|
||||||
<< "Member count of " << chat_id << " has changed from " << c->participant_count << " to "
|
<< "Number of members in " << chat_id << " has changed from " << c->participant_count << " to "
|
||||||
<< participant_count << ", but version " << c->version << " remains unchanged" << debug_str;
|
<< participant_count << ", but version " << c->version << " remains unchanged" << debug_str;
|
||||||
repair_chat_participants(chat_id);
|
repair_chat_participants(chat_id);
|
||||||
}
|
}
|
||||||
@ -11839,7 +11839,7 @@ bool ContactsManager::on_update_chat_full_participants_short(ChatFull *chat_full
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(INFO) << "Member count of " << chat_id << " with version " << chat_full->version
|
LOG(INFO) << "Number of members in " << chat_id << " with version " << chat_full->version
|
||||||
<< " has changed, but new version is " << version;
|
<< " has changed, but new version is " << version;
|
||||||
repair_chat_participants(chat_id);
|
repair_chat_participants(chat_id);
|
||||||
return false;
|
return false;
|
||||||
|
@ -6145,18 +6145,18 @@ void MessagesManager::on_update_dialog_online_member_count(DialogId dialog_id, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!dialog_id.is_valid()) {
|
if (!dialog_id.is_valid()) {
|
||||||
LOG(ERROR) << "Receive online member count in invalid " << dialog_id;
|
LOG(ERROR) << "Receive number of online members in invalid " << dialog_id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_broadcast_channel(dialog_id)) {
|
if (is_broadcast_channel(dialog_id)) {
|
||||||
LOG_IF(ERROR, online_member_count != 0)
|
LOG_IF(ERROR, online_member_count != 0)
|
||||||
<< "Receive online member count " << online_member_count << " in a broadcast " << dialog_id;
|
<< "Receive " << online_member_count << " as a number of online members in a channel " << dialog_id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (online_member_count < 0) {
|
if (online_member_count < 0) {
|
||||||
LOG(ERROR) << "Receive online member count " << online_member_count << " in a " << dialog_id;
|
LOG(ERROR) << "Receive " << online_member_count << " as a number of online members in a " << dialog_id;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10500,8 +10500,8 @@ void MessagesManager::set_dialog_online_member_count(DialogId dialog_id, int32 o
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto &info = dialog_online_member_counts_[dialog_id];
|
auto &info = dialog_online_member_counts_[dialog_id];
|
||||||
LOG(INFO) << "Change online member count from " << info.online_member_count << " to " << online_member_count << " in "
|
LOG(INFO) << "Change number of online members from " << info.online_member_count << " to " << online_member_count
|
||||||
<< dialog_id << " from " << source;
|
<< " in " << dialog_id << " from " << source;
|
||||||
bool need_update = d->is_opened && (!info.is_update_sent || info.online_member_count != online_member_count);
|
bool need_update = d->is_opened && (!info.is_update_sent || info.online_member_count != online_member_count);
|
||||||
info.online_member_count = online_member_count;
|
info.online_member_count = online_member_count;
|
||||||
info.updated_time = Time::now();
|
info.updated_time = Time::now();
|
||||||
@ -10524,7 +10524,7 @@ void MessagesManager::on_update_dialog_online_member_count_timeout(DialogId dial
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(INFO) << "Expired timeout for online member count for " << dialog_id;
|
LOG(INFO) << "Expired timeout for number of online members in " << dialog_id;
|
||||||
Dialog *d = get_dialog(dialog_id);
|
Dialog *d = get_dialog(dialog_id);
|
||||||
CHECK(d != nullptr);
|
CHECK(d != nullptr);
|
||||||
if (!d->is_opened) {
|
if (!d->is_opened) {
|
||||||
|
Loading…
Reference in New Issue
Block a user