Skip to content

Show an account provider picker on the server confirmation screen when required. #4137

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

Merged
merged 5 commits into from
May 20, 2025

Conversation

pixlwave
Copy link
Member

Will only be shown if the app is configured with multiple account providers and restricted to not allow any other provider to be selected. Can be reviewed commit-by-commit.

Screen.Recording.2025-05-20.at.3.52.39.pm.mov

@pixlwave pixlwave requested a review from a team as a code owner May 20, 2025 14:53
@pixlwave pixlwave added the pr-misc for other changes label May 20, 2025
@pixlwave pixlwave requested review from Velin92 and removed request for a team May 20, 2025 14:53
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to simplify this as discussed in #4131 (comment)

Ah crap, that wasn't what the comment suggested 🙈

Copy link
Member Author

Choose a reason for hiding this comment

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

Follow-up to #4131 (comment)

Copy link

codecov bot commented May 20, 2025

Codecov Report

Attention: Patch coverage is 85.20900% with 46 lines in your changes missing coverage. Please review.

Project coverage is 79.34%. Comparing base (a618f14) to head (ffbabc9).
Report is 2 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...owCoordinators/AuthenticationFlowCoordinator.swift 0.00% 29 Missing ⚠️
...onScreen/ServerConfirmationScreenCoordinator.swift 0.00% 7 Missing ⚠️
...urces/ServerConfirmationScreenViewModelTests.swift 96.09% 5 Missing ⚠️
...tionScreen/ServerConfirmationScreenViewModel.swift 93.75% 3 Missing ⚠️
...irmationScreen/View/ServerConfirmationScreen.swift 97.22% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4137      +/-   ##
===========================================
+ Coverage    79.24%   79.34%   +0.09%     
===========================================
  Files          813      813              
  Lines        74184    74418     +234     
===========================================
+ Hits         58787    59045     +258     
+ Misses       15397    15373      -24     
Flag Coverage Δ
unittests 71.50% <85.20%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +108 to +118
// Don't bother reconfiguring the service if it has already been done for the selected server.
let homeserver = authenticationService.homeserver.value
guard homeserver.loginMode == .unknown || homeserver.address != accountProvider else {
await fetchLoginURLIfNeededAndContinue()
return
}

// Note: We don't show the spinner until now as it isn't needed if the service is already
// configured and we're about to use password based login
startLoading()
defer { stopLoading() }
Copy link
Member

Choose a reason for hiding this comment

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

I guess this code is reused across the 2 functions and could be extracted into a separate function

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 ever so slightly different. The first one checks whether the flow matches, the second checks whether the server is the same.

Copy link
Member

@Velin92 Velin92 left a comment

Choose a reason for hiding this comment

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

LGTM

@pixlwave pixlwave merged commit 5197e41 into develop May 20, 2025
12 checks passed
@pixlwave pixlwave deleted the doug/account-provider-picker branch May 20, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-misc for other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants