GetStream / stream-ruby

Ruby Client - Build Activity Feeds & Streams with GetStream.io
https://getstream.io
BSD 3-Clause "New" or "Revised" License
85 stars 32 forks source link

DELETE operations need feature parity #111

Closed rromanchuk closed 5 years ago

rromanchuk commented 5 years ago

I understand that there are probably technical complexities which make these operations very difficult to provide

For example, this needs parity with unfollow_many(follows)

# Batch following many feeds (requires ruby 2.1 or later)
follows = [
  {:source => 'flat:1', :target => 'user:1'},
  {:source => 'flat:1', :target => 'user:2'},
  {:source => 'flat:1', :target => 'user:3'},
]
client.follow_many(follows)

and user_feed_1.remove_activities(activities)

# Batch adding activities
activities = [
    [:actor => '1', :verb => 'tweet', :object => '1'],
    [:actor => '2', :verb => 'like', :object => '3']
]
user_feed_1.add_activities(activities)

I've seen a lot of questions where the response is usually ¯_(ツ)_/¯, or just to orphan the data. The biggest use case is user deletion/deactivation. To actually delete the users footprint is an incredibly painful operation with thousands and thousands of api calls required depending on the user.

rromanchuk commented 5 years ago

Also, i realized today, my follow operation has been subscribing to an additional feed group that is unused, i fixed the superfluous target, but now I need to go in and start unsubscribing targets to my entire user base. I started running this script but saw

The only exception is unfollows. The unfollow operation is very heavy on our infrastructure and an additional 25 feed updates are billed for every unfollow operation.

This makes sense, but i really need to purge/truncate an entire feed group, and manually running unfollow, i believe, is my only way to prevent these zero value feed updates to unused feed groups.

rromanchuk commented 5 years ago

Actually, i was able to delete the entire feed group, that should solve the case i am looking for