Added logging of api updates when deleted message is unknown.

This commit is contained in:
23rd
2025-10-10 19:01:17 +03:00
committed by John Preston
parent d51195a537
commit 384f6d9a31
3 changed files with 22 additions and 0 deletions
+11
View File
@@ -1627,6 +1627,17 @@ void Updates::feedUpdate(const MTPUpdate &update) {
auto &d = update.c_updateNewChannelMessage();
auto channel = session().data().channelLoaded(peerToChannel(PeerFromMessage(d.vmessage())));
const auto isDataLoaded = AllDataLoadedForMessage(&session(), d.vmessage());
{
// Todo delete.
const auto messageId = IdFromMessage(d.vmessage());
if (const auto history = channel ? session().data().historyLoaded(channel) : nullptr) {
if (history->isUnknownMessageDeleted(messageId)) {
LOG(("Unknown message deleted detected for channel %1, message %2")
.arg(channel->id.value & PeerId::kChatTypeMask)
.arg(messageId.bare));
}
}
}
if (!requestingDifference() && (!channel || isDataLoaded != DataIsLoadedResult::Ok)) {
MTP_LOG(0, ("getDifference "
"{ good - after not all data loaded in updateNewChannelMessage }%1"
+8
View File
@@ -2976,11 +2976,19 @@ bool History::shouldBeInChatList() const {
}
void History::unknownMessageDeleted(MsgId messageId) {
LOG(("History::unknownMessageDeleted. Peer ID: %1, Message ID: %2.")
.arg(peer->id.value & PeerId::kChatTypeMask)
.arg(messageId.bare));
_unknownDeletedMessages[messageId] = base::unixtime::now();
if (_inboxReadBefore && messageId >= *_inboxReadBefore) {
owner().histories().requestDialogEntry(this);
}
}
bool History::isUnknownMessageDeleted(MsgId messageId) const {
return _unknownDeletedMessages.contains(messageId);
}
bool History::isServerSideUnread(not_null<const HistoryItem*> item) const {
Expects(item->isRegular());
+3
View File
@@ -249,6 +249,7 @@ public:
[[nodiscard]] bool lastMessageKnown() const;
[[nodiscard]] bool lastServerMessageKnown() const;
void unknownMessageDeleted(MsgId messageId);
[[nodiscard]] bool isUnknownMessageDeleted(MsgId messageId) const;
void applyDialogTopMessage(MsgId topMessageId);
void applyDialog(Data::Folder *requestFolder, const MTPDdialog &data);
void applyPinnedUpdate(const MTPDupdateDialogPinned &data);
@@ -668,6 +669,8 @@ private:
base::flat_map<Data::DraftKey, int> _savingCloudDraftRequests;
base::flat_map<Data::DraftKey, Data::ForwardDraft> _forwardDrafts;
base::flat_map<MsgId, TimeId> _unknownDeletedMessages;
QString _topPromotedMessage;
QString _topPromotedType;