Command exited with code 0. Command output: log(f"[fcm sync] Synced old FCM credentials for {synced} user(s)") async def shutdown(self) -> None: for task in list(self.bridge_tasks.values()): task.cancel() self.bridge_tasks.clear() if self.http: await self.http.close() if self.main_client_ready and self.main_client: try: await self.main_client.stop() except Exception: pass try: await self.bot.stop() except Exception: pass async def _deactivate_duplicate_groups(self, ws: Workspace) -> None: if not ws.active or not ws.group_id: return target_group = self._canonical_chat_id(ws.group_id) current_user = ws.user_id for other_uid, other_ws in list(self.workspaces.items()): if other_uid == current_user: continue if not other_ws.active or not other_ws.group_id: continue if self._canonical_chat_id(other_ws.group_id) == target_group: other_ws.active = False self.save_workspace(other_ws) await self.stop_bridge_runtime(other_uid, keep_state=True) log(f"[session auto-pause] Deactivated duplicate session for user {other_uid} because user {current_user} activated group {target_group}") premium_emoji = "[✨](tg://emoji?id=5258500422393415126)" body = ( f"⚠️ **Session Paused Automatically**\n\n" f"Your active session has been paused because another user is now actively monitoring the group `{target_group}`.\n\n" f"Only one user can actively monitor a group at a time." ) await self.send(other_uid, fmt_msg("Session Paused", body, error=True)) async def ensure_bridge_runtime(self, ws: Workspace) -> None: if not ws.active or not ws.device_id: return await self._deactivate_duplicate_groups(ws) user_id = ws.user_id if not self.main_client_ready: await self.send(ws.user_id, fmt_msg("Session Not Ready", "Main Telegram session is not ready yet. Please wait.", error=True), keyboard=self._workspace_menu(ws)) return task: Optional[asyncio.Task] = None if ws.active_mode in ("firebase", "fcm") and ws.forward_to: existing = self.bridge_tasks.get(user_id) if existing and not existing.done(): return task = asyncio.create_task(self._watch_firebase(user_id)) self.bridge_tasks[user_id] = task log(f"Bridge started for user {user_id} ({ws.active_mode}).") await self._auto_pin_status(ws) async def refresh_bridge_runtime(self, ws: Workspace) -> None: user_id = ws.user_id if not ws.active or not ws.device_id: await self.stop_bridge_runtime(user_id, keep_state=True) return await self._deactivate_duplicate_groups(ws)