Fix AP re-publish: use versioned object IDs after Delete
After Delete + re-Create, Mastodon tombstones the old object ID and ignores new Creates with the same ID. Now appends /v2, /v3 etc. so remote servers treat re-publishes as fresh posts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -288,6 +288,20 @@ class SqlFederationService:
|
||||
).scalars().first()
|
||||
return _activity_to_dto(a) if a else None
|
||||
|
||||
async def count_activities_for_source(
|
||||
self, session: AsyncSession, source_type: str, source_id: int,
|
||||
*, activity_type: str,
|
||||
) -> int:
|
||||
from sqlalchemy import func
|
||||
result = await session.execute(
|
||||
select(func.count()).select_from(APActivity).where(
|
||||
APActivity.source_type == source_type,
|
||||
APActivity.source_id == source_id,
|
||||
APActivity.activity_type == activity_type,
|
||||
)
|
||||
)
|
||||
return result.scalar_one()
|
||||
|
||||
# -- Followers ------------------------------------------------------------
|
||||
|
||||
async def get_followers(
|
||||
|
||||
Reference in New Issue
Block a user