mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
parent
8a77939d5b
commit
a0828f6ddf
3 changed files with 85 additions and 1 deletions
|
|
@ -34,8 +34,10 @@ class FSMContextMiddleware(BaseMiddleware):
|
|||
context = self.resolve_event_context(bot, data)
|
||||
data["fsm_storage"] = self.storage
|
||||
if context:
|
||||
data.update({"state": context, "raw_state": await context.get_state()})
|
||||
# Bugfix: https://github.com/aiogram/aiogram/issues/1317
|
||||
# State should be loaded after lock is acquired
|
||||
async with self.events_isolation.lock(key=context.key):
|
||||
data.update({"state": context, "raw_state": await context.get_state()})
|
||||
return await handler(event, data)
|
||||
return await handler(event, data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue