mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Refactor reply-fetching code and disable it by default (#34147)
This commit is contained in:
@@ -85,7 +85,6 @@ RSpec.describe Status::FetchRepliesConcern do
|
||||
|
||||
it 'shows the status as unsubscribed' do
|
||||
expect(Status.unsubscribed).to eq([status])
|
||||
expect(status.unsubscribed?).to be(true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -96,7 +95,6 @@ RSpec.describe Status::FetchRepliesConcern do
|
||||
|
||||
it 'shows the status as unsubscribed' do
|
||||
expect(Status.unsubscribed).to eq([status])
|
||||
expect(status.unsubscribed?).to be(true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -107,7 +105,6 @@ RSpec.describe Status::FetchRepliesConcern do
|
||||
|
||||
it 'shows the status as unsubscribed' do
|
||||
expect(Status.unsubscribed).to eq([status])
|
||||
expect(status.unsubscribed?).to be(true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -118,14 +115,12 @@ RSpec.describe Status::FetchRepliesConcern do
|
||||
|
||||
it 'does not show the status as unsubscribed' do
|
||||
expect(Status.unsubscribed).to eq([])
|
||||
expect(status.unsubscribed?).to be(false)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the status has no followers' do
|
||||
it 'shows the status as unsubscribed' do
|
||||
expect(Status.unsubscribed).to eq([status])
|
||||
expect(status.unsubscribed?).to be(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -296,12 +296,6 @@ RSpec.describe ActivityPub::FetchRemoteStatusService do
|
||||
it_behaves_like 'no delete'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the status is from an account with local followers' do
|
||||
let(:follow) { Fabricate(:follow, account: follower, target_account: sender, created_at: 2.days.ago) }
|
||||
|
||||
it_behaves_like 'no delete'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
|
||||
end
|
||||
|
||||
before do
|
||||
stub_const('Status::FetchRepliesConcern::FETCH_REPLIES_ENABLED', true)
|
||||
allow(FetchReplyWorker).to receive(:push_bulk)
|
||||
all_items.each do |item|
|
||||
next if [top_note_uri, reply_note_uri].include? item
|
||||
|
||||
Reference in New Issue
Block a user