Clarification on Idempotency for Specific Activity Types (Like, Announce, Follow) #2308
Replies: 2 comments 1 reply
-
5.5 Inverse Activities and "Undo" Several of the core Activity types are defined as natural inversions of one another. These include: Accept and Reject, It is important to note that these types of activities are semantically distinct from one another and have no direct relationship on the other. That is, for example, if an actor "likes" a note at one point in time then later "dislikes" it, the "dislike" activity does not "undo" or negate out the prior "like". The Undo activity type is defined to provide the specific ability to undo or cancel out a prior activity. The appropriate interpretation for the following, then, is that Sally liked John's note at one point but has explicitly redacted that like later on. https://www.w3.org/wiki/ActivityPub/Primer/Referring_to_activities
w3c/activitypub#384
w3c/activitypub#381
There's clearly a gap between AP's technical activity processing and the user-visible semantics. If you send two Likes of a given object, with two different ids, and then Undo one of them, AP may specify that the other one remains in the likes/liked collections. OK. But that may not match user expectations, ie if a user currently likes a post, and then they unlike it, they then no longer (visibly) like it.
The hard part is that all activities can be considered a "post" -- there is no real concept of a "post" in the social media sense. A Like activity can be directly translated into a "John liked this" type of post, as seen on Facebook. https://www.w3.org/wiki/ActivityPub/Primer/Like_activity
https://seb.jambor.dev/posts/understanding-activitypub-part-2-lemmy/
w3c/activitypub#386 Idempotence of
|
Beta Was this translation helpful? Give feedback.
-
https://www.w3.org/TR/activitypub/#update-activity-outbox 6.3 Update ActivityThe 6.3.1 Partial UpdatesFor client to server interactions, updates are partial; rather than updating the document all at once, any key value pair supplied is used to replace the existing value with the new value. This only applies to the top-level fields of the updated object. A special exception is for when the value is the json Note that this behavior is for client to server interaction where the client is posting to the server only. Server to server interaction and updates from the server to the client should contain the entire new representation of the object, after the partial update application has been applied. See the description of the Update activity for server to server interactions for more details. https://www.w3.org/TR/activitypub/#update-activity-inbox 7.3 Update ActivityFor server to server interactions, an The receiving server MUST take care to be sure that the Since WordPress already has a built-in revision system, I believe implementing Partial Updates would be relatively easy. However, one thing I found curious is that when inspecting the outbox, I noticed both Create and Update activities being published. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
1. Clarification on Idempotency for Specific Activity Types (Like, Announce, Follow)
The ActivityPub specification and subsequent discussions have highlighted ambiguities regarding the idempotency of certain core activities, particularly in how they are stored, retrieved, and processed, which can lead to inter-server interoperability challenges.
This discussion aims to clarify the preferred behavior for the
wordpress-activitypub
plugin regarding activity idempotency.Key Activities for Consideration
Like
Activity:Like
andDislike
) are semantically distinct and do not inherently "undo" each other. However, most Fediverse implementations treat an actor'sLike
on a specific object as idempotent, meaning an actor can only have one activeLike
on a single object at a time. Theliked
collection is usually unique byobject
ID.wordpress-activitypub
plugin enforce idempotency forLike
activities (oneLike
per actor per object, with a newLike
replacing the old one, or simply being ignored if one exists), or should it allow multiple distinctLike
activities (each with a uniqueid
) as technically permitted by ActivityPub's simple collection model?Announce
Activity (Boost/Renote):Announce
activities are not idempotent, allowing for multiple announcements of the same object (e.g., reminding about an event). However, platforms like Mastodon enforce idempotency (one boost per post), while others like Misskey allow multiple "Renotes."Create
activity with acontent
and acontext
/inReplyTo
pointing to the original post, or using thequote
property which is not standard AP but widely used) effectively covers the use case of re-sharing with added commentary, I propose the following for pureAnnounce
activities:Announce
of non-event objects (e.g.,Note
,Article
) for better compatibility with major Fediverse servers like Mastodon.Announce
for objects where repetition is semantically meaningful (e.g.,Event
reminders), and also be prepared to receive and store non-idempotentAnnounce
from other platforms (like Misskey's renotes) to maintain the integrity of the object'sshares
collection.General Activity ID vs. Semantics:
id
(making it technically non-duplicate in a Collection) conflicts with its semantic meaning (e.g., a user should only "like" a post once).Undo
should target a specific activityid
. If we enforce semantic idempotency forLike
, anUndo
should effectively target the single existingLike
activity.We welcome input from maintainers and the community on the chosen approach for the WordPress plugin to ensure broad interoperability while adhering to common user expectations.
2. Outbox Optimization: Deduplication and Display of Latest Object State
본문:
Problem
When an actor on a WordPress site publishes a post (via a
Create
activity) and subsequently edits it multiple times (generating severalUpdate
activities), the actor's Outbox currently exposes both the originalCreate
activity and all subsequentUpdate
activities.This behavior has several potential issues:
Update
for a given object ID.The ActivityPub specification states the Outbox "contains activities the user has published" and is a feed of "continued relevance," but does not explicitly forbid or mandate showing all updates. However, the spirit of a social media "feed" often suggests displaying the latest state.
Proposal: Outbox Deduplication and State Consolidation
To optimize the Outbox and align with common Fediverse user experience, we propose the following change in how the Outbox is constructed for an actor's core objects (e.g.,
Note
,Article
):Prioritize Latest Activity: For any object that has been created and subsequently updated, the Outbox should prioritize showing only the most recent activity related to that object.
Update
activity.Create
activity.Delete
activity should, of course, be displayed as the latest state and potentially cause the object to be removed from the Outbox entirely (depending on implementation choice for deleted content).Display Consolidated Object: Regardless of whether the Outbox entry is a
Create
or anUpdate
activity, the embeddedobject
should always reflect the current, latest state of the WordPress post/object (i.e., the state after all partial updates have been applied), as required for Server-to-ServerUpdate
delivery.This approach effectively treats the Outbox as a deduplicated, chronological stream of the actor's current relevant activities, rather than a full revision log.
We request discussion on the technical implementation of this deduplication and its impact on clients consuming the Outbox.
(참고: 해당 제안은 WordPress의
revision
기능과 별개로, Outbox에 노출되는 활동의 목록 자체를 경량화하는 데 중점을 둡니다.)Beta Was this translation helpful? Give feedback.
All reactions