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

Make list of default servers configurable (IOS-171) #1081

Merged
merged 4 commits into from Jul 2, 2023

Conversation

zeitschlag
Copy link
Member

@zeitschlag zeitschlag commented Jul 2, 2023

  • Download a list of suggested servers from api.joinmastodon.org
  • Randomly pick on (based on a weighted list)
  • Make the "Join $defaultServer"-button join this instance

Server list from backend has a weight which plays a role in which server gets selected.
mastodon.social is the fallback in case something goes wrong
@zeitschlag zeitschlag marked this pull request as ready for review July 2, 2023 12:46
@zeitschlag zeitschlag requested a review from kimar July 2, 2023 12:46
@zeitschlag zeitschlag added this to the 2023.11 milestone Jul 2, 2023
Copy link
Member

@kimar kimar left a comment

Choose a reason for hiding this comment

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

LGTM 👍


func downloadDefaultServer(completion: (() -> Void)? = nil) {
context.apiService.defaultServers()
.timeout(.milliseconds(500) , scheduler: DispatchQueue.main)
Copy link
Member

Choose a reason for hiding this comment

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

❓ What's this timeout for?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a requirement/design-decision: If getting the list from the server takes longer than 500ms, we fallback to mastodon.social

@zeitschlag zeitschlag merged commit a843d94 into develop Jul 2, 2023
2 checks passed
@zeitschlag zeitschlag deleted the ios-171-list-of-default-servers branch July 2, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants