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

Feat: add a build setting flag to always show the server selection screen in login/registration flow. #7541

Merged
merged 2 commits into from
May 11, 2023

Conversation

nimau
Copy link
Contributor

@nimau nimau commented May 10, 2023

This PR adds a flag in the BuildSettings to force the user to set a homeserver url instead of using the default one.

@nimau nimau force-pushed the nimau/PSB349_force_hs_selection branch from a23a168 to fd251ac Compare May 10, 2023 07:47
@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Patch coverage: 25.71% and project coverage change: -0.15 ⚠️

Comparison is base (ef4d85d) 12.36% compared to head (eae51b3) 12.22%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7541      +/-   ##
===========================================
- Coverage    12.36%   12.22%   -0.15%     
===========================================
  Files         1646     1646              
  Lines       163465   163517      +52     
  Branches     67128    67128              
===========================================
- Hits         20213    19983     -230     
- Misses      142589   142888     +299     
+ Partials       663      646      -17     
Flag Coverage Δ
uitests 55.05% <0.00%> (-0.01%) ⬇️
unittests 6.06% <25.71%> (-0.15%) ⬇️

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

Impacted Files Coverage Δ
Config/BuildSettings.swift 43.07% <ø> (ø)
...les/Authentication/AuthenticationCoordinator.swift 0.00% <0.00%> (ø)
...tor/AuthenticationServerSelectionCoordinator.swift 0.00% <0.00%> (ø)
...thentication/Legacy/AuthenticationViewController.m 35.74% <31.25%> (-0.10%) ⬇️
...s/Authentication/Common/AuthenticationModels.swift 51.21% <100.00%> (+5.27%) ⬆️

... and 22 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nimau nimau force-pushed the nimau/PSB349_force_hs_selection branch 2 times, most recently from 7a369ae to 7d27935 Compare May 10, 2023 12:42
@nimau nimau force-pushed the nimau/PSB349_force_hs_selection branch from 7d27935 to 6e251b7 Compare May 10, 2023 13:46
@nimau nimau marked this pull request as ready for review May 10, 2023 13:47
@nimau nimau requested review from a team, Velin92 and pixlwave and removed request for a team and Velin92 May 10, 2023 13:47
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

Nice, glad a simple solution worked for this!

Config/BuildSettings.swift Outdated Show resolved Hide resolved
Comment on lines 134 to 138
// Use the homeserver defined by a provisioningLink or by the user (if none is set, the default one will be used)
let homeserverAddress = authenticationService.provisioningLink?.homeserverUrl ?? authenticationService.state.homeserver.addressFromUser

// Check if the user must select a server
if BuildSettings.forceHomeserverSelection, homeserverAddress == nil {
Copy link
Member

Choose a reason for hiding this comment

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

First off, good job remembering to check the provisioning link - I would have forgotten about that 😃

However we shouldn't include the addressFromUser here as it alters the intended behaviour where navigating back to the carousel and starting again defaults to matrix.org once more. Could probably remove the let homeserverAddress here, check the provisioning link directly in the if and then call startFlow(flow) like before without an address.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I updated it that way.

Copy link
Member

Choose a reason for hiding this comment

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

Perfect, thanks 👍

@sonarcloud
Copy link

sonarcloud bot commented May 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nimau nimau requested a review from pixlwave May 11, 2023 07:51
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@nimau nimau merged commit cc9bc24 into develop May 11, 2023
@nimau nimau deleted the nimau/PSB349_force_hs_selection branch May 11, 2023 12:57
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.

4 participants