Merge commit '8a46c747dbca2999bab4493826451e4a4fa96ff8' into glitch-soc/merge-4.4

This commit is contained in:
Claire
2026-01-30 18:21:18 +01:00
4 changed files with 17 additions and 1 deletions

View File

@@ -70,6 +70,7 @@ class ConnectionPool::SharedTimedStack
if @created == @max && !@queue.empty? if @created == @max && !@queue.empty?
throw_away_connection = @queue.pop throw_away_connection = @queue.pop
@tagged_queue[throw_away_connection.site].delete(throw_away_connection) @tagged_queue[throw_away_connection.site].delete(throw_away_connection)
throw_away_connection.close
@create_block.call(preferred_tag) @create_block.call(preferred_tag)
elsif @created != @max elsif @created != @max
connection = @create_block.call(preferred_tag) connection = @create_block.call(preferred_tag)

View File

@@ -205,7 +205,11 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
def update_tags! def update_tags!
previous_tags = @status.tags.to_a previous_tags = @status.tags.to_a
current_tags = @status.tags = Tag.find_or_create_by_names(@raw_tags) current_tags = @status.tags = @raw_tags.flat_map do |tag|
Tag.find_or_create_by_names([tag]).filter(&:valid?)
rescue ActiveRecord::RecordInvalid
[]
end
return unless @status.distributable? return unless @status.distributable?

View File

@@ -64,6 +64,16 @@ class MoveWorker
.in_batches do |follows| .in_batches do |follows|
ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id) ListAccount.where(follow: follows).in_batches.update_all(account_id: @target_account.id)
num_moved += follows.update_all(target_account_id: @target_account.id) num_moved += follows.update_all(target_account_id: @target_account.id)
# Clear any relationship cache, since callbacks are not called
Rails.cache.delete_multi(follows.flat_map do |follow|
[
['relationship', follow.account_id, follow.target_account_id],
['relationship', follow.target_account_id, follow.account_id],
['relationship', follow.account_id, @target_account.id],
['relationship', @target_account.id, follow.account_id],
]
end)
end end
num_moved num_moved

View File

@@ -258,6 +258,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
tag: [ tag: [
{ type: 'Hashtag', name: 'foo' }, { type: 'Hashtag', name: 'foo' },
{ type: 'Hashtag', name: 'bar' }, { type: 'Hashtag', name: 'bar' },
{ type: 'Hashtag', name: '#2024' },
], ],
} }
end end