mirror of
https://github.com/langgenius/dify.git
synced 2026-07-15 17:37:38 +08:00
Socket.IO event handlers run in plain gevent greenlets without a Flask application context, so the db.session() call added in #38227 raises RuntimeError: Working outside of application context, and every user_connect is rejected as unauthorized. Wrap the authorization call in sio.app.app_context(), matching the existing connect handler.