Compare commits

...

1 Commits

Author SHA1 Message Date
giles
5480f1ae2e Add debug logging to federation publish handler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 23:12:05 +00:00

View File

@@ -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.debug("_try_publish: no federation service")
return
if not user_id:
log.debug("_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,6 +48,7 @@ async def _try_publish(
session, source_type, source_id,
)
if existing and activity_type == "Create":
log.debug("_try_publish: already published %s#%s", source_type, source_id)
return # Already published
try: