Command exited with code 0. Command output: - unpinned = True - except Exception as e: - log(f"[pin] unpin old failed: {e}") - if not unpinned: + try: await self._http_unpin_message(int(ws.user_id), old_id) + except Exception as e: + log(f"[pin] unpin old failed: {e}") if msg_id: - pinned = False - if self.bot and getattr(self.bot, "is_connected", False): - try: - await asyncio.wait_for( - self.bot.pin_chat_message(int(ws.user_id), msg_id, both_sides=True, disable_notification=True), - timeout=3.0 - ) - pinned = True - ws.pinned_status_msg_id = msg_id - self.save_workspace(ws) - log(f"[pin] status pinned for {ws.user_id}") - except Exception as e: - log(f"[pin] pin failed: {e}") - if not pinned: + try: if await self._http_pin_message(int(ws.user_id), msg_id): ws.pinned_status_msg_id = msg_id self.save_workspace(ws) - log(f"[pin] status pinned for {ws.user_id} via HTTP API") + log(f"[pin] status pinned for {ws.user_id}") + except Exception as e: + log(f"[pin] pin failed: {e}") def _load_collected_firebases(self) -> dict[str, Any]: if COLLECTED_FB_FILE.exists(): @@ -2617,13 +2564,8 @@ self.save_workspace(ws) elif seed.status in (401, 403, 404, 423): consecutive_errors += 1 - if consecutive_errors >= 6: - log(f"[fb poll {user_id}] Seed HTTP {seed.status} repeated. Auto-pausing.") - ws.active = False - self.save_workspace(ws) - await self.send(user_id, fmt_msg("Firebase Paused", f"⚠️ Database returned HTTP {seed.status}. Paused automatically.", error=True)) - break - await asyncio.sleep(20) + log(f"[fb poll {user_id}] Seed HTTP {seed.status} (attempt {consecutive_errors}). Backing off 25s...") + await asyncio.sleep(25) continue await asyncio.sleep(poll_interval) continue @@ -2632,13 +2574,8 @@ if r.status != 200: consecutive_errors += 1 if r.status in (401, 403, 404, 423): - if consecutive_errors >= 6: - log(f"[fb poll {user_id}] Persistent HTTP {r.status} error ({consecutive_errors} times). Auto-pausing.") - ws.active = False - self.save_workspace(ws) - await self.send(user_id, fmt_msg("Firebase Paused", f"⚠️ Database returned HTTP {r.status} repeatedly. Paused automatically.", error=True)) - break - await asyncio.sleep(20) + log(f"[fb poll {user_id}] HTTP {r.status} (error count {consecutive_errors}). Backing off 25s...") + await asyncio.sleep(25) else: await asyncio.sleep(poll_interval) continue @@ -2693,12 +2630,6 @@ consecutive_errors += 1 err_text = str(exc).lower() if "name or service not known" in err_text or "cannot connect to host" in err_text or "nodename" in err_text: - if consecutive_errors >= 5: - log(f"[fb poll {user_id}] Persistent host failure. Auto-pausing.") - ws.active = False - self.save_workspace(ws) - await self.send(user_id, fmt_msg("Firebase Paused", "⚠️ Host domain could not be reached repeatedly. Paused automatically.", error=True)) - break log(f"[fb poll {user_id}] Host connection/lookup failed: {exc}. Backing off 30s...") await asyncio.sleep(30) else: