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 <noreply@anthropic.com>
This commit is contained in:
parent
73e8e4b507
commit
e725f33ed3
@ -174,10 +174,10 @@ class Bot():
|
|||||||
return self.__sub_help()
|
return self.__sub_help()
|
||||||
|
|
||||||
async def __sub_actualize_names(self) -> str:
|
async def __sub_actualize_names(self) -> str:
|
||||||
|
await self.__bot.get_dialogs()
|
||||||
subs = self.__config.list_subscriptions()
|
subs = self.__config.list_subscriptions()
|
||||||
if not subs:
|
if not subs:
|
||||||
return "No subscriptions"
|
return "No subscriptions"
|
||||||
await self.__bot.get_dialogs()
|
|
||||||
lines = []
|
lines = []
|
||||||
for i, s in enumerate(subs, start=1):
|
for i, s in enumerate(subs, start=1):
|
||||||
src = s.get('srcChatId')
|
src = s.get('srcChatId')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user