Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix edge case where accepted follow cannot be processed because of fo…
Browse files Browse the repository at this point in the history
…llow limit (mastodon#16098)
  • Loading branch information
ClearlyClaire authored Apr 23, 2021
1 parent 2360191 commit a6564d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/follow_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FollowRequest < ApplicationRecord
validates :account_id, uniqueness: { scope: :target_account_id }

def authorize!
account.follow!(target_account, reblogs: show_reblogs, notify: notify, uri: uri)
account.follow!(target_account, reblogs: show_reblogs, notify: notify, uri: uri, bypass_limit: true)
MergeWorker.perform_async(target_account.id, account.id) if account.local?
destroy!
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/follow_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:target_account) { Fabricate(:account) }

it 'calls Account#follow!, MergeWorker.perform_async, and #destroy!' do
expect(account).to receive(:follow!).with(target_account, reblogs: true, notify: false, uri: follow_request.uri)
expect(account).to receive(:follow!).with(target_account, reblogs: true, notify: false, uri: follow_request.uri, bypass_limit: true)
expect(MergeWorker).to receive(:perform_async).with(target_account.id, account.id)
expect(follow_request).to receive(:destroy!)
follow_request.authorize!
Expand Down

0 comments on commit a6564d5

Please sign in to comment.