From 6d0d1d64801e9c5ccc7a8df1d036a9d2cd9682d8 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Tue, 20 Aug 2019 23:31:37 +0200 Subject: [PATCH] Fix for buggy updates --- core/activitypub.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/activitypub.py b/core/activitypub.py index 93a25f6..e43653c 100644 --- a/core/activitypub.py +++ b/core/activitypub.py @@ -179,7 +179,16 @@ def post_to_inbox(activity: ap.BaseActivity) -> None: Tasks.process_reply(activity.get_object_id()) return - # Hubzilla forward activities in a Create, process them as possible replies + # Hubzilla sends Update with the same ID as the actor, and it poisons the cache + if ( + activity.has_type(ap.ActivityType.UPDATE) + and activity.id == activity.get_object_id() + ): + # Start a task to update the cached actor + Tasks.cache_actor(activity.id) + return + + # Hubzilla forwards activities in a Create, process them as possible replies if activity.has_type(ap.ActivityType.CREATE) and server(activity.id) != server( activity.get_object_id() ):