diff --git a/events/handlers/federation_handlers.py b/events/handlers/federation_handlers.py index 152434f..1f4c6b5 100644 --- a/events/handlers/federation_handlers.py +++ b/events/handlers/federation_handlers.py @@ -30,14 +30,17 @@ async def _try_publish( ) -> None: """Publish an AP activity if federation is available and user has a profile.""" if not services.has("federation"): + log.warning("_try_publish: no federation service") return if not user_id: + log.warning("_try_publish: no user_id for %s#%s", source_type, source_id) return # Check user has an ActorProfile (chose a username) actor = await services.federation.get_actor_by_user_id(session, user_id) if not actor: + log.warning("_try_publish: no ActorProfile for user_id=%s", user_id) return # Don't re-publish if we already have an activity for this source @@ -45,8 +48,10 @@ async def _try_publish( session, source_type, source_id, ) if existing and activity_type == "Create": + log.warning("_try_publish: already published %s#%s", source_type, source_id) return # Already published + log.warning("_try_publish: publishing %s/%s for %s#%d user=%s", activity_type, object_type, source_type, source_id, user_id) try: await services.federation.publish_activity( session, @@ -57,7 +62,7 @@ async def _try_publish( source_type=source_type, source_id=source_id, ) - log.info( + log.warning( "Published %s/%s for %s#%d by user %d", activity_type, object_type, source_type, source_id, user_id, )