Skip non-collection urls in process links service (#38351)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Matt JankowskiandClaire authored and GitHub committed 2026-03-24 09:52:35 +00:00
1 parent 014e85ba9d
commit 0ef43a431d
2 files changed
+10

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ class ProcessLinksService < BaseService
# TODO: We probably want to resolve unknown objects at authoring time
object = ActivityPub::TagManager.instance.uri_to_resource(url.to_s, Collection)
next if object.nil?
tagged_object = @previous_objects.find { |x| x.object == object || x.uri == url }
tagged_object ||= @current_objects.find { |x| x.object == object || x.uri == url }
@@ -16,4 +16,13 @@ RSpec.describe ProcessLinksService do
.to change { status.tagged_objects.count }.by(1)
end
end
context 'when status has a generic link' do
let(:status) { Fabricate(:status, account: account, text: 'Hello check out my personal web page: https://example.com/test', visibility: :public) }
it 'skips the link and does not create a tagged object' do
expect { expect { subject.call(status) }.to_not raise_error }
.to not_change { status.tagged_objects.count }.from(0)
end
end
end