From 0a997aabbc90ca65483ca2cb2347f658cfcd9211 Mon Sep 17 00:00:00 2001 From: yoniebans Date: Mon, 29 Jun 2026 12:34:19 +0200 Subject: [PATCH] fix(gateway): route aliased SessionDB calls through AsyncSessionDB The migration's call-site sweep keyed on the literal self._session_db. spelling and missed calls bound to a local first (db = getattr(self, '_session_db', None); db.method(...)). Convert the three in async contexts: get_telegram_topic_binding in the topic-rename coroutine, and the two update_session_model sites on the model-switch path. --- gateway/run.py | 2 +- gateway/slash_commands.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gateway/run.py b/gateway/run.py index fb0cf0ae4d0..6a0a1ca0146 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -12338,7 +12338,7 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew session_db = getattr(self, "_session_db", None) if session_db is not None: try: - binding = session_db.get_telegram_topic_binding( + binding = await session_db.get_telegram_topic_binding( chat_id=str(source.chat_id), thread_id=str(source.thread_id), ) diff --git a/gateway/slash_commands.py b/gateway/slash_commands.py index c952013378f..fbcfa048ef3 100644 --- a/gateway/slash_commands.py +++ b/gateway/slash_commands.py @@ -1308,7 +1308,7 @@ class GatewaySlashCommandsMixin: _sess_entry = _self.session_store.get_or_create_session( event.source ) - _sess_db.update_session_model( + await _sess_db.update_session_model( _sess_entry.session_id, result.new_model ) except Exception as exc: @@ -1539,7 +1539,7 @@ class GatewaySlashCommandsMixin: # override just stored below (Closes #48031). if getattr(_sess_entry, "was_auto_reset", False): _sess_entry.was_auto_reset = False - _sess_db.update_session_model( + await _sess_db.update_session_model( _sess_entry.session_id, result.new_model ) except Exception as exc: