From e725f33ed3e6e3cb8beb104d76e1b4d1ce0fd398 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Sun, 28 Jun 2026 20:27:11 +0300 Subject: [PATCH] Fix !sub names: read config after get_dialogs, not before list_subscriptions() was called before the get_dialogs() await. During that await the event loop could process a !reload and replace self.__config; subsequent set_name calls would then update the orphaned old config object while !sub list reads from the new one. Move list_subscriptions() after get_dialogs() so both the entity cache and the config snapshot are taken from the same post-reload state. Co-Authored-By: Claude Sonnet 4.6 --- src/bot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bot/bot.py b/src/bot/bot.py index 6e94450..0e103e4 100644 --- a/src/bot/bot.py +++ b/src/bot/bot.py @@ -174,10 +174,10 @@ class Bot(): return self.__sub_help() async def __sub_actualize_names(self) -> str: + await self.__bot.get_dialogs() subs = self.__config.list_subscriptions() if not subs: return "No subscriptions" - await self.__bot.get_dialogs() lines = [] for i, s in enumerate(subs, start=1): src = s.get('srcChatId')