diff --git a/activities/models/fan_out.py b/activities/models/fan_out.py index a0de7b8..6ecfbd1 100644 --- a/activities/models/fan_out.py +++ b/activities/models/fan_out.py @@ -23,6 +23,10 @@ class FanOutStates(StateGraph): fan_out = await instance.afetch_full() + # Don't try to fan out to identities that are not fetched yet + if not (fan_out.identity.local or fan_out.identity.inbox_uri): + return + match (fan_out.type, fan_out.identity.local): # Handle creating/updating local posts case ((FanOut.Types.post | FanOut.Types.post_edited), True): diff --git a/users/models/inbox_message.py b/users/models/inbox_message.py index bc47728..d6f3839 100644 --- a/users/models/inbox_message.py +++ b/users/models/inbox_message.py @@ -135,8 +135,11 @@ class InboxMessage(StatorModel): return self.message["type"].lower() @property - def message_object_type(self): - return self.message["object"]["type"].lower() + def message_object_type(self) -> str | None: + if isinstance(self.message["object"], dict): + return self.message["object"]["type"].lower() + else: + return None @property def message_type_full(self):