Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick a different instance upon redirect #5154

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

epicsam123
Copy link

Currently, the redirect url may redirect the user back to the same instance they are currently on.

@epicsam123 epicsam123 requested a review from a team as a code owner January 22, 2025 22:34
@epicsam123 epicsam123 requested review from syeopite and removed request for a team January 22, 2025 22:34
Copy link
Member

@syeopite syeopite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crystal if blocks needs to be explicitly closed with an end statement

@syeopite syeopite added the unfinished More work is needed on this PR, or on something this PR uses. label Jan 23, 2025
@epicsam123 epicsam123 requested a review from syeopite January 24, 2025 03:18
Copy link
Member

@syeopite syeopite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the lint issues.

@@ -42,12 +42,17 @@ module Invidious::Routes::Misc
referer = get_referer(env)

instance_list = Invidious::Jobs::InstanceListRefreshJob::INSTANCES["INSTANCES"]
if instance_list.empty?
# Filter out the current instance
other_available_instances = instance_list.reject! { |_, domain| domain == CONFIG.domain }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
other_available_instances = instance_list.reject! { |_, domain| domain == CONFIG.domain }
other_available_instances = instance_list.reject { |_, domain| domain == CONFIG.domain }

reject! modifies itself instead of creating a new Tuple. other_available_instances isn't necessary unless you're using reject

Copy link
Member

@syeopite syeopite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@syeopite syeopite added need-testing This feature needs to be deployed and tested to see if it's working, and doesn't break something and removed unfinished More work is needed on this PR, or on something this PR uses. labels Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-testing This feature needs to be deployed and tested to see if it's working, and doesn't break something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants