diff options
author | ThibG <thib@sitedethib.com> | 2017-09-12 23:10:40 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-09-12 23:10:40 +0200 |
commit | f29918e7071160f277ac5834d83e409d8fa20063 (patch) | |
tree | 8bb9cd0e949c8ebf3122d2a0f162a569e2222189 /app/services/activitypub/process_account_service.rb | |
parent | af10c9fbfff237e45ff46355d118e6824ae05b79 (diff) |
[WiP] Whenever a remote keypair changes, unfollow them and re-subscribe to … (#4907)
* Whenever a remote keypair changes, unfollow them and re-subscribe to them In Mastodon (it could be different for other OStatus or AP-enabled software), a keypair change is indicative of whole user (or instance) data loss. In this situation, the “new” user might be different, and almost certainly has an empty followers list. In this case, Mastodon instances will disagree on follower lists, leading to unreliable delivery and “shadow followers”, that is users believed by a remote instance to be followers, without the affected user knowing. Drawbacks of this change are: 1. If an user legitimately changes public key for some reason without losing data (not possible in Mastodon at the moment), they will have their remote followers unsubscribed/re-subscribed needlessly. 2. Depending of the number of remote followers, this may generate quite some traffic. 3. If the user change is an attempt at usurpation, the remote followers will unknowingly follow the usurper. Note that this is *not* a change of behavior, Mastodon already behaves like that, although delivery might be unreliable, and the usurper would not have known the former user's followers. * Rename ResubscribeWorker to RefollowWorker * Process followers in batches
Diffstat (limited to 'app/services/activitypub/process_account_service.rb')
-rw-r--r-- | app/services/activitypub/process_account_service.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index b54e447ad..badb26720 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -17,7 +17,9 @@ class ActivityPub::ProcessAccountService < BaseService create_account if @account.nil? upgrade_account if @account.ostatus? + old_public_key = @account.public_key update_account + RefollowWorker.perform_async(@account.id) if old_public_key != @account.public_key @account rescue Oj::ParseError |