Inline federation publication + fix AP delivery
- Replace async federation_handlers with inline try_publish() at write sites - Fix ap_delivery_handler: urlparse for signature path/host, @context array with security vocab, Delete/Tombstone object handling - Fix federation_impl: @context array for IPFS, .limit(1) + upsert follower Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,10 @@ def _build_activity_json(activity: APActivity, actor: ActorProfile, domain: str)
|
|||||||
obj.setdefault("published", activity.published.isoformat() if activity.published else None)
|
obj.setdefault("published", activity.published.isoformat() if activity.published else None)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
"https://w3id.org/security/v1",
|
||||||
|
],
|
||||||
"id": activity.activity_id,
|
"id": activity.activity_id,
|
||||||
"type": activity.activity_type,
|
"type": activity.activity_type,
|
||||||
"actor": actor_url,
|
"actor": actor_url,
|
||||||
|
|||||||
@@ -163,7 +163,10 @@ class SqlFederationService:
|
|||||||
from shared.utils.ipfs_client import add_json, is_available
|
from shared.utils.ipfs_client import add_json, is_available
|
||||||
if await is_available():
|
if await is_available():
|
||||||
activity_json = {
|
activity_json = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
"https://w3id.org/security/v1",
|
||||||
|
],
|
||||||
"id": activity_uri,
|
"id": activity_uri,
|
||||||
"type": activity_type,
|
"type": activity_type,
|
||||||
"actor": f"https://{domain}/users/{username}",
|
"actor": f"https://{domain}/users/{username}",
|
||||||
|
|||||||
Reference in New Issue
Block a user