Deleting activities with the Feeds API can be confusing because the behavior can be slightly different depending on two factors
- The method used to delete the activity
- Which feed the activity is deleted from
Methods for deleting an Activity from a Feed
There are two methods for deleting an activity from a Feed
Removing an activity by id
const feed = client.feed(feed_group, feed_id);
const removed = await feed.removeActivity(activity_id)
Removing an activity by foreign id
const feed = client.feed(feed_group, feed_id);
const removed = await feed.removeActivity({ foreign_id })
Which Feed the Activity is deleted from
An activity can be added to a feed explicitly, through targeting, or through fan-out via a follow relationship. An activity explicitly added to a particular feed makes that feed the origin of the activity. An activity deleted from the origin is also deleted from all other feeds where it is found, either through fan-out or targeting. Deleting an activity from a feed that is not the origin of the activity, will delete it only from that feed.
In the below example, feed user:virgo is followed by three timeline feeds. The activity with id:xyz_123 can be deleted either from the origin (user:virgo) or from one of the three timeline feeds. If the activity is deleted from the origin feed, then it is also removed from the three timeline feeds. However, if it is deleted from one of the three timeline feeds, then it is deleted only from that feed because the timeline feed is not the origin.
For any questions, please feel free to email the Stream Customer Success team at
Comments
0 comments
Please sign in to leave a comment.