[go: up one dir, main page]

Skip to content

Investigate remote mirror logic for blocked URLs

I was investigating another issue and noticed the remote mirror update logic appears flawed.

In the UpdateRemoteMirrorService we have a comment that blocked URLs result in a hard fail but the logic tries to retry

I believe we should change this to simply

remote_mirror.hard_fail!(_('The remote mirror URL is invalid.'))

Edit: the previous section appears to be intentional from !57392 (comment 540149493) so we should ideally update the comment to clarify.

I also noticed that we're then returning remote_mirror.last_error which in this case should be the error we just specified _('The remove mirror URL is invalid.'). If that's the case it's probably easier to read and understand if we just return that error e.g.

message = _('The remote mirror URL is invalid.')
remote_mirror.hard_fail!(message)
return error(message)

I'm also wondering if we should also update this error to say "The remote mirror URL is blocked" so it's clear to the end user why this failed.

Edited by Joe Woodward