This is an adaptation of the main ActivityPub description of side effects, while adapting it to what the Processing and Storage packages will need to do:
Create activity:¶
- Get object ID (non write)
- If Object is an actor type, try to generate its public/private key
- Write object to storage
- Get activity ID (non write)
- Write activity to storage
- Add activity/object ID to recipients collections (async with respect to writes?)
Update/Delete activity¶
- Write object to storage
- Get activity ID (non write)
- Write activity to storage
- Add activity/object ID to recipients collections (async)
Like/Dislike activity¶
- Get activity ID (non write)
- Write activity to storage
- Add activity ID to recipients collections (async)
- Add activity ID to the object’s Likes and the object’s ID to the actor’s Liked collection (async)
Announce activity¶
- Get activity ID (non write)
- Write activity to storage
- Add activity ID to recipients collections (async)
- Add activity ID to object’s Shares collection (async)
Follow activity¶
- Get activity ID (non write)
- Write activity to storage
- Add activity ID to recipients collections (async)
- If Object is remote and server responds with 201 we add it to the Actor’s followed collection.
- If Object is remote and server responds with 200 we wait for an Accept activity matching the Follow.
Accept/TentativeAccept activity¶
- Get activity ID (non-write)
- Write activity to storage
- Add activity ID to recipients collections (async)
- If object is Follow, add the actor to the the object’s Followed and object to the actor’s Following collections (async)
Reject/TentativeReject activity¶
- Get activity ID (non-write)
- Write activity to storage
Block activity¶
- Get activity ID (non write)
- Write activity to storage
- Add activity ID to recipients collections (async)
- Add object ID to the actor’s blocked collection (async). Blocked is a FedBOX custom collection.
Undo activity¶
- Process side-effects (async maybe?) This needs expansion based on type of Activity we have as an object.
- Get activity ID (non write)
- Write activity to storage
- Add activity ID to recipients collections (async)
Add/Remove activity¶
- Get activity ID (non write)
- Write activity to storage
- Add activity ID to recipients collections (async)
- Add/Remove object ID to the target, if target is a local collection (async)
Question (intransitive)activity¶
- Get activity ID (non write)
- Write to storage the items in the
anyOforoneOfproperties. - Write activity to storage
- Add activity ID to recipients collections (async)