Fix sidekiq JSON serialization warning in ActivityPub::FetchAllRepliesWorker (#34702)
				
					
				
			This commit is contained in:
		@@ -80,7 +80,7 @@ class ActivityPub::FetchAllRepliesWorker
 | 
			
		||||
    root_status_body = fetch_resource(root_status_uri, true)
 | 
			
		||||
    return if root_status_body.nil?
 | 
			
		||||
 | 
			
		||||
    FetchReplyWorker.perform_async(root_status_uri, { **options, prefetched_body: root_status_body })
 | 
			
		||||
    FetchReplyWorker.perform_async(root_status_uri, { **options.deep_stringify_keys, 'prefetched_body' => root_status_body })
 | 
			
		||||
 | 
			
		||||
    get_replies(root_status_body, MAX_PAGES, options)
 | 
			
		||||
  end
 | 
			
		||||
 
 | 
			
		||||
@@ -124,8 +124,6 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
 | 
			
		||||
 | 
			
		||||
  before do
 | 
			
		||||
    stub_const('Status::FetchRepliesConcern::FETCH_REPLIES_ENABLED', true)
 | 
			
		||||
    allow(FetchReplyWorker).to receive(:push_bulk)
 | 
			
		||||
    allow(FetchReplyWorker).to receive(:perform_async)
 | 
			
		||||
    all_items.each do |item|
 | 
			
		||||
      next if [top_note_uri, reply_note_uri].include? item
 | 
			
		||||
 | 
			
		||||
@@ -150,7 +148,7 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
 | 
			
		||||
 | 
			
		||||
    it 'fetches the top status only once' do
 | 
			
		||||
      _ = subject.perform(status.id, { request_id: 0 })
 | 
			
		||||
      expect(FetchReplyWorker).to have_received(:perform_async).with(top_note_uri, { prefetched_body: top_object.deep_stringify_keys, request_id: 0 })
 | 
			
		||||
      expect(FetchReplyWorker).to have_enqueued_sidekiq_job(top_note_uri, { 'prefetched_body' => top_object.deep_stringify_keys, 'request_id' => 0 })
 | 
			
		||||
      expect(a_request(:get, top_note_uri)).to have_been_made.once
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user