3

The documentation states that the uniqueness of an activity is either determined by time or by time plus foreign id.

We would like to suppress similar activities (like "user 1 updated article 2") within e.g. the same hour of the day to prevent spamming the followers.

We tried to do this via timestamps rounded to the full hour, but this resulted in a messed up order of activities where a subsequent activity had a lower id than another one that was added minutes before it.

Is there any other way than filtering out the activities on retrieval using aggregated feeds?

Olsu
  • 93
  • 1
  • 5
  • do you keep a reference of this data in your database (eg. a change log table for the example you made)? – Tommaso Barbugli Apr 26 '16 at 19:51
  • No, currently there is no audit / change log. – Olsu Apr 27 '16 at 06:47
  • keeping a change log is probably the easiest way to go about this. once you have that in your application it's really easy to create activities based on different conditions. The complexity of building/maintaining such system is also really low. – Tommaso Barbugli Apr 27 '16 at 09:20

1 Answers1

1

I would handle this client side and only post an update to Stream if more than 1h has passed since the last update.

Thierry
  • 3,225
  • 1
  • 26
  • 26
  • 1
    Yes, we also thought about doing it this way. But this would mean one or even more timestamp fields on each entity just for this purpose. The article use case I gave was just a simplified example. Our entities allow multiple interactions, each associated with their own Stream verb we would have to keep a separate timestamp for. – Olsu Apr 27 '16 at 06:55