From 14295d59d187c9002919a6acf64ba4287dc4e650 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 Nov 2025 12:55:44 +0400 Subject: [PATCH] Add some debug logs on app startup timing. --- Telegram/SourceFiles/main/main_session.cpp | 1 + .../SourceFiles/storage/storage_account.cpp | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/main/main_session.cpp b/Telegram/SourceFiles/main/main_session.cpp index f0c893a5c1..1d869150d5 100644 --- a/Telegram/SourceFiles/main/main_session.cpp +++ b/Telegram/SourceFiles/main/main_session.cpp @@ -222,6 +222,7 @@ Session::Session( data().stickers().notifyUpdated(Data::StickersType::Masks); data().stickers().notifyUpdated(Data::StickersType::Emoji); data().stickers().notifySavedGifsUpdated(); + DEBUG_LOG(("Init: Account stored data load finished.")); }); #ifndef TDESKTOP_DISABLE_SPELLCHECK diff --git a/Telegram/SourceFiles/storage/storage_account.cpp b/Telegram/SourceFiles/storage/storage_account.cpp index ab62a58beb..fd3221d346 100644 --- a/Telegram/SourceFiles/storage/storage_account.cpp +++ b/Telegram/SourceFiles/storage/storage_account.cpp @@ -2585,6 +2585,8 @@ void Account::importOldRecentStickers() { } void Account::readInstalledStickers() { + DEBUG_LOG(("Init: Read installed sticker sets.")); + if (!_installedStickersKey) { return importOldRecentStickers(); } @@ -2597,6 +2599,8 @@ void Account::readInstalledStickers() { } void Account::readFeaturedStickers() { + DEBUG_LOG(("Init: Read featured sticker sets.")); + readStickerSets( _featuredStickersKey, &_owner->session().data().stickers().featuredSetsOrderRef(), @@ -2616,6 +2620,8 @@ void Account::readFeaturedStickers() { } void Account::readFeaturedCustomEmoji() { + DEBUG_LOG(("Init: Read featured emoji sets.")); + readStickerSets( _featuredCustomEmojiKey, &_owner->session().data().stickers().featuredEmojiSetsOrderRef(), @@ -2623,18 +2629,26 @@ void Account::readFeaturedCustomEmoji() { } void Account::readRecentStickers() { + DEBUG_LOG(("Init: Read recent stickers.")); + readStickerSets(_recentStickersKey); } void Account::readRecentMasks() { + DEBUG_LOG(("Init: Read recent masks.")); + readStickerSets(_recentMasksKey); } void Account::readFavedStickers() { + DEBUG_LOG(("Init: Read faved masks.")); + readStickerSets(_favedStickersKey); } void Account::readArchivedStickers() { + DEBUG_LOG(("Init: Read archived stickers.")); + // TODO: refactor to support for multiple accounts. static bool archivedStickersRead = false; if (!archivedStickersRead) { @@ -2646,6 +2660,8 @@ void Account::readArchivedStickers() { } void Account::readArchivedMasks() { + DEBUG_LOG(("Init: Read archived masks.")); + // TODO: refactor to support for multiple accounts. static bool archivedMasksRead = false; if (!archivedMasksRead) { @@ -2657,6 +2673,8 @@ void Account::readArchivedMasks() { } void Account::readInstalledMasks() { + DEBUG_LOG(("Init: Read installed masks.")); + readStickerSets( _installedMasksKey, &_owner->session().data().stickers().maskSetsOrderRef(), @@ -2664,6 +2682,8 @@ void Account::readInstalledMasks() { } void Account::readInstalledCustomEmoji() { + DEBUG_LOG(("Init: Read installed emoji sets.")); + readStickerSets( _installedCustomEmojiKey, &_owner->session().data().stickers().emojiSetsOrderRef(), @@ -2699,7 +2719,11 @@ void Account::writeSavedGifs() { } void Account::readSavedGifs() { - if (!_savedGifsKey) return; + DEBUG_LOG(("Init: Read saved GIFs.")); + + if (!_savedGifsKey) { + return; + } FileReadDescriptor gifs; if (!ReadEncryptedFile(gifs, _savedGifsKey, _basePath, _localKey)) {