Add subscribing and pushing for releases actor
Why are we doing this work
After adding the profile and outbox parts of the releases actor, we need to allow to subscribe to it. This happens in several steps:
- we need to add an
inbox
url in the profile of the actor - at that url, an endpoint allows posting subscription payload (the Follow activity)
- when receiving a Follow activity, we store it in database, storing the url of the follower inbox (passed in the request) and the id of the Follow activity
- when it's stored, we send an Accept activity to the follower's inbox
- when a new release is created, we send a Create activity to each follower's inbox, with the object being the release object as we've already implemented in the outbox.
- when receiving a Undo activity mentioning previous Follow, we remove the subscription from our database.
The Follow activity payload
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"id": "https://social.example/alyssa/posts/a29a6843-9feb-4c74-a7f7-081b9c9201d3",
"to": PROJECT_RELEASES_URL
"actor": "https://social.example/alyssa/",
"object": {
"type": "Follow",
"actor": {
"type": "Person",
"inbox": "https://inbox-url",
},
"object": {
"type": "Application",
"id": PROJECT_RELEASES_URL,
},
}
}
Relevant links
Non-functional requirements
-
Documentation: -
Testing:
Implementation plan
-
inbox endpoint -
model and table to store followers -
job to fire Accept request and retry/abandon it -
job queued when a new release is created to push on followers inboxes
Verification steps
When the code is ready, ask a review from groupscalability folks.
TBD
Edited by kik