Quantcast
Channel: Active questions tagged feed - Stack Overflow
Viewing all articles
Browse latest Browse all 547

GetStream creates same activity in different feeds

$
0
0

I built this piece of code to add tags to my tag feed.

buildActivity = (model,obj) => {  return {    ...{      actor: `user:model.user`,      verb: 'is',      object: `model:${model.id}`,      foreign_id: `model:${model.id}`,      time: model.createdAt.toDate(),    },    ...(obj ? obj : {})  }}addActivitiesToTagFeed = async (model,tags) => {  const promises = []  for(let i=0;i<tags.length;i++){    const tag = tags[i]    const activity = buildActivity(model,{target: `tag:${tag}`})    const feed = stream.feed('tag', tag)    promises.push(feed.addActivity(activity))  }  await Promise.all(promises)}

Which I limited to max 3 tags. I can have liketag:netflixtag:filmstag:suspense

The problem is somehow the activity created by addActivity is the same to all tags. The same target, even the same activity id. It is breaking my 'tag_aggregated' that only follows one of those tags.

Ideas anyone how to fix it?


Viewing all articles
Browse latest Browse all 547

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>