-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue: Should idempotency (or not) of certain activities be explicit? #381
Comments
Really great thought experiment! There's clearly a gap between AP's technical activity processing and the user-visible semantics. If you send two For "stateful" toggle activities like these - likes, follows, etc - do we implicitly expect server implementations to first look up whether the toggle is "on" for a given user, ie whether they have an "outstanding" |
|
@snarfed I think "stateful" is a really dangerous thing to start building around. If you start explicitly assuming there is a state, then you will eventually consider whether it is necessary to synchronize that state... and that's not always the same as synchronizing the resources themselves. You have to keep track of whether an activity was processed or not, which possibly means retrying delivery if you don't get an explicit signal telling you the activity was successfully or unsuccessfully processed. I'd rather keep it as an implementation detail or decision as to whether certain activities should be idempotent, but I recognize that this can lead to UX fractures between systems that assume one way vs systems that assume the other way. For my part, I'd recommend trying to separate the side-effects from the resources. Architect the system such that you only ever care about which objects are in which collections, and "state synchronization" is as easy as fetching the latest collection. Of course this requires objects to explicitly be in collections, rather than only implicitly grouped together by assumption. For example: explicitly maintaining a profile rather than just assuming that all Create/Announce/etc represent posts on the same profile. For what it's worth, the answer to your Like example is that you would end up with the object no longer in |
Absolutely right, hence "gap between AP's technical activity processing and the user-visible semantics." One option would be to punt on this in AP and say that product behavior and user-visible semantics are out of scope. I'm not sure about that, since AS2 vocab seems to bring them pretty squarely into scope, but 🤷♂️. Another option would be to define a very basic first level of semantics. For example, in this case, which activities should be stateful (idempotent) vs stateless. For example, reposts could be stateless, ie you could repost the same post multiple times, like Tumblr, but likes and followers could be stateful, ie a first like would toggle that state on for a given object, successive likes would do nothing, and an undo of any like would toggle it back off. (I expect any semantics like those would be SHOULD, not MUST.) I don't actually know which of those options AP should do, if either, and if we did semantics, I'm sure there would be lots of debate over which to use. Interesting to think all this through though. |
In the case that:
Might it help to have a FEP or two defining how an implementation handles this? That way, at least the "assumptions about which path another instance/codebase took on this issue" could be derisked by reference to FEP implementation conformance (however that's signaled)... |
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. You could even treat a Follow like this, albeit you can't actually verify that it was accepted. "John followed Sally" would more accurately be expressed to external audiences as "John requested to follow Sally". |
For both of the above pages, I gave some Postel guidance on what to do with multiple |
Great point here in a thread about something tangential. Want to make sure this is picked up later if a new major version of the spec is ever undertaken.
In case the above link breaks between now and then, the relevant quote from @trwnh is:
The text was updated successfully, but these errors were encountered: