0

We are having problems while using the social graph features of Apache Usergrid (2.1). Here is a sample:

We have this scenario (sandbox rules are off):

  • We have group1, user1 and user2
  • User1 and user2 follows group1
  • User1 posts to group1 -> the post is visible in both user1's and user2's feed
  • User2 unfollows group1
  • The post in group1 is still visible in user2's feed

I do not know the internals of the usergrid feed system, but I assume that it is copying / caching the data that was visible to the user at some point of time. However, this usage conflicts with the social graph, if the user unfollows a user/group, the posts should be hidden from the user's feed.

Are there any methods for implementing this scenario correctly? Usergrid documentation does not tell anything about this.

Eren Yilmaz
  • 1,082
  • 12
  • 21
  • My guess is that this is expensive behavior because it would be expensive for UG to rewrite the history of the user's feed. I think all that you can do is filter the feed before you display it. You would need to do a GET on /users/user1/following, then ensure anything in the feed that doesn't appear in the returned entities array gets removed. – amuramoto Jun 07 '16 at 22:19
  • That would reqire a "not in" query, and that's not supported in UG. Doing it in a middleware or in the client is not a good idea IMO, that would include lots of tricks in the application. I think I'll go with deleting the feed entries from the user's stream when the user unfollows a group. – Eren Yilmaz Jun 08 '16 at 08:56

0 Answers0