mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-18 12:30:03 +00:00
Fix account migration form ever using outdated account data (#18429)
This commit is contained in:
parent
317ec06dc7
commit
dc5c86add7
|
@ -31,7 +31,7 @@ class Form::Redirect
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_target_account
|
def set_target_account
|
||||||
@target_account = ResolveAccountService.new.call(acct)
|
@target_account = ResolveAccountService.new.call(acct, skip_cache: true)
|
||||||
rescue Webfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error
|
rescue Webfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error
|
||||||
# Validation will take care of it
|
# Validation will take care of it
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,7 @@ class ResolveAccountService < BaseService
|
||||||
# @param [Hash] options
|
# @param [Hash] options
|
||||||
# @option options [Boolean] :redirected Do not follow further Webfinger redirects
|
# @option options [Boolean] :redirected Do not follow further Webfinger redirects
|
||||||
# @option options [Boolean] :skip_webfinger Do not attempt any webfinger query or refreshing account data
|
# @option options [Boolean] :skip_webfinger Do not attempt any webfinger query or refreshing account data
|
||||||
|
# @option options [Boolean] :skip_cache Get the latest data from origin even if cache is not due to update yet
|
||||||
# @option options [Boolean] :suppress_errors When failing, return nil instead of raising an error
|
# @option options [Boolean] :suppress_errors When failing, return nil instead of raising an error
|
||||||
# @return [Account]
|
# @return [Account]
|
||||||
def call(uri, options = {})
|
def call(uri, options = {})
|
||||||
|
@ -120,7 +121,7 @@ class ResolveAccountService < BaseService
|
||||||
return false if @options[:check_delivery_availability] && !DeliveryFailureTracker.available?(@domain)
|
return false if @options[:check_delivery_availability] && !DeliveryFailureTracker.available?(@domain)
|
||||||
return false if @options[:skip_webfinger]
|
return false if @options[:skip_webfinger]
|
||||||
|
|
||||||
@account.nil? || @account.possibly_stale?
|
@options[:skip_cache] || @account.nil? || @account.possibly_stale?
|
||||||
end
|
end
|
||||||
|
|
||||||
def activitypub_ready?
|
def activitypub_ready?
|
||||||
|
|
Loading…
Reference in a new issue