fix(ext+hub): v0.5.2 Idle→Resume 신호 소실 3중 버그 수정 — auth_fail 재연결 + pending_owners 보존 + step-probe 리셋
This commit is contained in:
20
hub.py
20
hub.py
@@ -269,11 +269,17 @@ class WSHub:
|
||||
self.project_connections[conn.project] = set()
|
||||
self.project_connections[conn.project].add(conn.conn_id)
|
||||
|
||||
# FIX: Reassign orphaned pending_owners (from dead conn_ids) to this new connection.
|
||||
# When Extension reconnects, old conn_id entries become stale.
|
||||
# FIX: Reassign orphaned pending_owners (from dead conn_ids or orphan markers)
|
||||
# to this new connection. When Extension reconnects, old entries become stale.
|
||||
reassigned = 0
|
||||
for rid, cid in list(self.pending_owners.items()):
|
||||
if cid not in self.connections:
|
||||
if cid.startswith("orphan:"):
|
||||
# Only reassign orphans from the same project
|
||||
if cid != f"orphan:{conn.project}":
|
||||
continue
|
||||
self.pending_owners[rid] = conn.conn_id
|
||||
reassigned += 1
|
||||
elif cid not in self.connections:
|
||||
self.pending_owners[rid] = conn.conn_id
|
||||
reassigned += 1
|
||||
if reassigned:
|
||||
@@ -324,7 +330,13 @@ class WSHub:
|
||||
f"(disconnected {conn_id})"
|
||||
)
|
||||
else:
|
||||
del self.pending_owners[rid]
|
||||
# Preserve as orphan marker instead of deleting —
|
||||
# will be reassigned when Extension reconnects
|
||||
self.pending_owners[rid] = f"orphan:{project}"
|
||||
logger.info(
|
||||
f"[HUB] Orphaned pending {rid[:12]} "
|
||||
f"(no active connections in {project})"
|
||||
)
|
||||
|
||||
# Close WebSocket if still open
|
||||
if not conn.ws.closed:
|
||||
|
||||
Reference in New Issue
Block a user