Commit 05e86c4f by sunqi02 Committed by 胡悦

fix(message-gate): ensure room_id is persisted when session pre-created by SessionBuffer

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a8a7598d
...@@ -40,6 +40,10 @@ class ActiveSessionService: ...@@ -40,6 +40,10 @@ class ActiveSessionService:
# 1. 先查内存(热路径) # 1. 先查内存(热路径)
existing = self.store.get(session_id) existing = self.store.get(session_id)
if existing: if existing:
# SessionBuffer 可能预创建 session 但不带 room_id,这里补上
if room_id and not existing.get("room_id"):
existing["room_id"] = room_id
self.store.set(session_id, existing)
return ActiveSessionInfo( return ActiveSessionInfo(
id=session_id, id=session_id,
session_id=session_id, session_id=session_id,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!