Log tries to send requests before authorization.

GitOrigin-RevId: 73d4efdaccf4564fa8558140380a845e2cc89c4b
This commit is contained in:
levlam 2020-06-04 00:22:21 +03:00
parent 9c5c112733
commit 1f1307ab42
4 changed files with 7 additions and 4 deletions

View File

@ -12625,7 +12625,7 @@ void MessagesManager::on_get_dialogs(FolderId folder_id, vector<tl_object_ptr<te
}
}
LOG(INFO) << "Receive " << dialogs.size() << " dialogs out of " << total_count << " in result of GetDialogsQuery";
LOG(INFO) << "Receive " << dialogs.size() << " dialogs out of " << total_count << " in " << folder_id;
std::unordered_map<FullMessageId, DialogDate, FullMessageIdHash> full_message_id_to_dialog_date;
std::unordered_map<FullMessageId, tl_object_ptr<telegram_api::Message>, FullMessageIdHash> full_message_id_to_message;
for (auto &message : messages) {

View File

@ -69,7 +69,7 @@ void SequenceDispatcher::try_resend_query(Data &data, NetQueryPtr query) {
data.state_ = State::Wait;
wait_cnt_++;
auto token = pos + id_offset_;
// TODO: is query is ok, use NetQueryCallback::on_result
// TODO: if query is ok, use NetQueryCallback::on_result
auto promise = PromiseCreator::lambda([&, self = actor_shared(this, token)](NetQueryPtr query) mutable {
if (!query.empty()) {
send_closure(std::move(self), &SequenceDispatcher::on_resend_ok, std::move(query));

View File

@ -59,9 +59,12 @@ NetQueryPtr NetQueryCreator::create(uint64 id, const telegram_api::Function &fun
auto td = G()->td();
if (!td.empty()) {
auto auth_manager = td.get_actor_unsafe()->auth_manager_.get();
if (auth_manager && auth_manager->is_bot()) {
if (auth_manager != nullptr && auth_manager->is_bot()) {
total_timeout_limit = 8;
}
if ((auth_manager == nullptr || !auth_manager->is_authorized()) && auth_flag == NetQuery::AuthFlag::On) {
LOG(ERROR) << "Send query before authorization: " << to_string(function);
}
}
}
auto query = object_pool_.create(NetQuery::State::Query, id, std::move(slice), BufferSlice(), dc_id, type, auth_flag,

View File

@ -47,7 +47,7 @@ void MultiPromiseActor::set_ignore_errors(bool ignore_errors) {
}
void MultiPromiseActor::set_result(Result<Unit> &&result) {
// MultiPromiseActor should be cleared before he begins to send out result
// MultiPromiseActor should be cleared before it begins to send out result
auto promises_copy = std::move(promises_);
promises_.clear();
auto futures_copy = std::move(futures_);