diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index 968440d99c..f3c0b56fc3 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -2322,7 +2322,7 @@ void ConnectionPrivate::requestsAcked(const QVector &ids, bool byRespon while (ackedCount-- > MTPIdsBufferSize) { auto i = wereAcked.begin(); clearedBecauseTooOld.push_back(RPCCallbackClear( - i.key(), + i.value(), RPCError::TimeoutError)); wereAcked.erase(i); } diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp index acd0917f46..3697280e64 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp +++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp @@ -941,6 +941,10 @@ void Instance::Private::clearCallbacks(mtpRequestId requestId, int32 errorCode) } } if (errorCode && found) { + LOG(("API Error: callbacks cleared without handling! " + "Request: %1, error code: %2" + ).arg(requestId + ).arg(errorCode)); rpcErrorOccured(requestId, h, internal::rpcClientError("CLEAR_CALLBACK", QString("did not handle request %1, error code %2").arg(requestId).arg(errorCode))); } }