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.
This commit is contained in:
yoniebans 2026-06-29 12:34:19 +02:00 committed by Teknium
parent 0896facce8
commit 0a997aabbc
2 changed files with 3 additions and 3 deletions

View file

@ -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),
)

View file

@ -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: