fix: V8.5 — connect()-Regression: Auto-Onboarding als Background-Task (asyncio.ensure_future statt await)

This commit is contained in:
Bernd (Hermes)
2026-07-19 10:54:29 +02:00
parent a6b8fecb4c
commit 536f3ecde0
+6 -6
View File
@@ -1303,15 +1303,15 @@ class RocketChatAdapter(BasePlatformAdapter):
missing = self.archivar.check_room_map_completeness(subscribed_with_types)
if missing:
logger.info("[rocketchat] B9: Reconnect — %d neue Räume gefunden, starte Onboarding", len(missing))
await self._start_onboarding(missing)
asyncio.ensure_future(self._start_onboarding(missing))
else:
# Keine neuen c/p-Räume — aber DM könnte noch Theme brauchen
await self._start_onboarding([])
asyncio.ensure_future(self._start_onboarding([]))
else:
missing = self.archivar.check_room_map_completeness(subscribed_with_types)
if missing:
logger.info("[rocketchat] B9: %d Räume fehlen in room-map.json — starte Auto-Onboarding", len(missing))
await self._start_onboarding(missing)
asyncio.ensure_future(self._start_onboarding(missing))
else:
# B9: Prüfe ob room-map.json leer ist (0 Räume) → trotzdem Onboarding
room_count = len(self.archivar._room_map.rooms) if self.archivar._room_map else 0
@@ -1321,13 +1321,13 @@ class RocketChatAdapter(BasePlatformAdapter):
if non_dm_rooms:
logger.info("[rocketchat] B9: room-map.json ist leer (0 Räume) — starte Auto-Onboarding für %d Räume", len(non_dm_rooms))
all_rooms = [{"room_id": rid, "name": info["name"]} for rid, info in non_dm_rooms.items()]
await self._start_onboarding(all_rooms)
asyncio.ensure_future(self._start_onboarding(all_rooms))
else:
# Nur DM — trotzdem Onboarding für DM-Theme
await self._start_onboarding([])
asyncio.ensure_future(self._start_onboarding([]))
else:
# Map hat Räume, keine neuen — aber DM könnte Theme brauchen
await self._start_onboarding([])
asyncio.ensure_future(self._start_onboarding([]))
except Exception as e:
logger.warning("[rocketchat] Archivar-Initialisierung fehlgeschlagen: %s — Fallback ohne Klassifikation", e)
self._mark_connected()