From b847e175971e6978e072ed31fc18220f717204ba Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 2 Apr 2019 01:13:04 +0300 Subject: [PATCH] Add crash debug. GitOrigin-RevId: b19258b9e707e614216fc816bf91a0032b07bddd --- td/telegram/NotificationManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index 6878cff48..72526041e 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -992,6 +992,12 @@ void NotificationManager::flush_pending_updates(int32 group_id, const char *sour // deletion, because number of notification should never exceed max_notification_group_size_, // and second addition, because we has kept the deletion + // TODO remove when the bug is fixed + string debug_updates; + for (auto &update : updates) { + debug_updates += PSTRING() << as_notification_update(update.get()); + } + // calculate last state of all notifications std::unordered_set added_notification_ids; std::unordered_set edited_notification_ids; @@ -1003,7 +1009,7 @@ void NotificationManager::flush_pending_updates(int32 group_id, const char *sour for (auto ¬ification : update_ptr->added_notifications_) { auto notification_id = notification->id_; bool is_inserted = added_notification_ids.insert(notification_id).second; - CHECK(is_inserted); // there must be no additions after addition + LOG_CHECK(is_inserted) << debug_updates; // there must be no additions after addition CHECK(edited_notification_ids.count(notification_id) == 0); // there must be no additions after edit removed_notification_ids.erase(notification_id); }