Add delay to profile updates to debounce them (#34137)

This commit is contained in:
Claire 2025-03-28 17:12:32 +01:00
parent 483b4600b5
commit 91ef24d0e3
12 changed files with 127 additions and 26 deletions

View file

@ -27,7 +27,7 @@ describe Api::V1::Accounts::CredentialsController do
describe 'with valid data' do
before do
allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_async)
allow(ActivityPub::UpdateDistributionWorker).to receive(:perform_in)
patch :update, params: {
display_name: "Alice Isn't Dead",
@ -58,7 +58,7 @@ describe Api::V1::Accounts::CredentialsController do
end
it 'queues up an account update distribution' do
expect(ActivityPub::UpdateDistributionWorker).to have_received(:perform_async).with(user.account_id)
expect(ActivityPub::UpdateDistributionWorker).to have_received(:perform_in).with(anything, user.account_id)
end
end