Search code examples
feedgetstream-io

GetStreamIO - Create feeds based on defined/special/custom aggregation


I am trying to figure out a situation using GetStream.IO but I am having issues while doing it...

I have an app and I want 3 different feeds:

  • User one (With all my activities if mine, or with all the activities of a given user)
  • Timeline TypeA (Based on the aggregation of user's TypeA activities I follow)
  • Timeline TypeB (Based on the aggregation of user's TypeB activities I follow)

I also need an activity one (X posted, Y followed you, etc) but for now I would like to focus on the situation above.

User A arrives in the App. He has two feeds

  • Feed with users typeA
  • Feed with users typeB

However, both type A and B are basically users (from inheritance pov). If I follow an user (through getstream IO), the aggregation will return me the results (activities) from both typeA/B users I follow, which I don't want to.

How could I solve this? (using getstreamIO only if possible)

Thanks


Solution

  • Since there is no filtering while pulling activities in a feed, classification should be done in feed group level. Important idea is to split user feed such that

    user_a:user_id and user_b:user_id then user:user_id feed can follow these two feeds.

    On top, timelines can follow their own kinds such that

    timeline_a:user_id follows user_a:user_id and aggregates it, similarly timeline_b:user_id follows user_b:user_id where each timeline see activities for their interested ones.

    If user wants to see whole aggregation, timeline:user_id could also be provided.