Fix MultipleResultsFound crash in get_activity_for_source
- Use .scalars().first() + LIMIT 1 instead of scalar_one_or_none() which crashes when multiple activities exist for the same source - Allow re-Create after Delete (re-publish after unpublish) - Add missing on_post_unpublished handler to root shared copy - Sync add_follower upsert fix to root shared Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -251,8 +251,9 @@ class SqlFederationService:
|
||||
APActivity.source_type == source_type,
|
||||
APActivity.source_id == source_id,
|
||||
).order_by(APActivity.created_at.desc())
|
||||
.limit(1)
|
||||
)
|
||||
).scalar_one_or_none()
|
||||
).scalars().first()
|
||||
return _activity_to_dto(a) if a else None
|
||||
|
||||
# -- Followers ------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user