Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rebootpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ async def _close(self, *,
self._clear_caches()

if self._ready_event is not None:
self._ready_event.set() # unblock any coroutines waiting on wait_until_ready()
self._ready_event.clear()

if close_http:
Expand Down Expand Up @@ -3073,6 +3074,8 @@ async def internal_auth_refresh_handler(self):
await self._reconnect_to_party()
except AttributeError:
pass
except Exception:
pass

async def _start(self, dispatch_ready: bool = True) -> None:
if self._first_start:
Expand Down
12 changes: 10 additions & 2 deletions rebootpy/xmpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ async def friend_event(self, ctx: EventContext) -> None:
body = ctx.body

await self.client.wait_until_ready()
if self.client._closing or self.client._closed:
return
_payload = body['payload']
_status = _payload['status']
_id = _payload['accountId']
Expand Down Expand Up @@ -449,7 +451,10 @@ async def event_blocklist_added(self, ctx: EventContext) -> None:
data = self.client.get_user(account_id)
if data is None:
if self.client.fetch_user_data_in_events:
data = await self.client.fetch_user(account_id, raw=True)
try:
data = await self.client.fetch_user(account_id, raw=True)
except RuntimeError:
return
else:
data = data.get_raw()

Expand All @@ -467,7 +472,10 @@ async def event_blocklist_remove(self, ctx: EventContext) -> None:
data = self.client.get_blocked_user(account_id)
if data is None:
if self.client.fetch_user_data_in_events:
data = await self.client.fetch_user(account_id, raw=True)
try:
data = await self.client.fetch_user(account_id, raw=True)
except RuntimeError:
return
else:
data = data.get_raw()

Expand Down