Веб-версияОткрыть в Telegram

Сообщение🎉 New Pull Request to ag2ai/faststream by @Vitaly312

1 октября 2026
G
🎉 New Pull Request to ag2ai/faststream by @Vitaly312 ✨ Fix: exit already entered middlewares if one fails to enter (#3252) 📊 +42/-11 🌿 Vitaly312:fix/middleware-enter-leak → main DESCRIPTION Fixes #3251 Middlewares were entered by hand, and their __aexit__ was pushed to the exit stack only after the message scope had been entered — so a failing on_receive left every already entered middleware without after_processed. They cannot just be entered with stack.enter_async_context, because then they would be exited after the message/log_context scope is released. Instead, the scope now gets its own stack, reserved before the middlewares are entered, which keeps the exit order and removes both push_async_exit loops. Side effect: an error raised in on_receive now reaches CriticalLogMiddleware and is logged. Previously it disappeared entirely. Type of change ☑️ Bug fix (a non-breaking change that resolves an issue) Checklist ☑️ My code adheres to the style guidelines of this project (just lint shows no errors) ☑️ I have conducted a self-review of my own code ☑️ My changes do not generate any new warnings ☑️ I have added tests to validate the effectiveness of my fix or the functionality of my new feature ☑️ Both new and existing unit tests pass successfully on my local environment by running just test-coverage ☑️ I have ensured that static analysis tests are passing by running just static-analysis sent via relator

Рядом в ленте

это сообщение
ББорис@diementros @ivan_kirpichnikov я там долгий тест убрал под mark slow, проверьте плз кто нибудь и слейтеИИван 🇷🇺done

Открытая публичная лента из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог · Поиск · Как мы считаем