V9.0.1: Rainer Quality Gate — 4 P1-Fixes
F1.1: Hook-Adapter-Bridge nutzt offizielle API (Modul-Level _active_adapter
statt privater ctx._adapter/ctx._platforms)
F1.2: Hook-Registrierung in connect()-Lifecycle-Phase (nicht register())
— Adapter ist dann vollständig initialisiert
F1.3: asyncio.Lock lazy-created (Python 3.14 forward-compat)
F2.1: 3 neue 429-Tests (kein Crash, Retry bei nächstem Hook, Telemetrie)
Tests: 39 passed, 99 skipped (V8.x), 0 failed
This commit is contained in:
@@ -1708,6 +1708,21 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
"(no running event loop)"
|
||||
)
|
||||
|
||||
# ── V9: Register Presence Hooks (F1.1 + F1.2) ──────────────────
|
||||
# Hooks werden erst hier registriert, nicht in register().
|
||||
# Grund: Der Adapter ist jetzt vollständig initialisiert (REST-Login,
|
||||
# PresenceEngine, asyncio-Loop). Die Hook-Callbacks nutzen die
|
||||
# Modul-Level-Referenz _active_adapter (offizielle API, F1.1).
|
||||
try:
|
||||
import plugin as _plugin_module
|
||||
_plugin_module._active_adapter = self
|
||||
_plugin_module._register_presence_hooks()
|
||||
logger.info("[rocketchat] V9: Presence-Hooks registriert via connect()")
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
"[rocketchat] V9: Presence-Hook-Registrierung fehlgeschlagen: %s", e
|
||||
)
|
||||
|
||||
# A1b: Subscribe to stream-notify-room for rooms-changed events
|
||||
if self.ddp.connected:
|
||||
room_events_sub = self.ddp.subscribe_room_events()
|
||||
@@ -6484,6 +6499,14 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
return text
|
||||
|
||||
async def disconnect(self) -> None:
|
||||
# ── V9: Clear active adapter reference (F1.1) ──
|
||||
try:
|
||||
import plugin as _plugin_module
|
||||
if _plugin_module._active_adapter is self:
|
||||
_plugin_module._active_adapter = None
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ── V9: Kein Busy-Done-Debounce mehr ──
|
||||
# ── P1b: Gate-Sweep-Task sauber beenden ──
|
||||
if hasattr(self, '_gate_sweep_task') and self._gate_sweep_task is not None:
|
||||
|
||||
Reference in New Issue
Block a user