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: bring back current login flow and add a feature flag for enterprise login [WPB-15543] #3817

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Jan 22, 2025

TaskWPB-15543 [Android] Add feature flag and keep current flow intact until switching to new one


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

We started implementing new enterprise login flow by modifying files from current one, but to make sure we keep having working login flow we need to keep current one intact and implement new one next to it so that it will be easy to switch to new one once everything is implemented and tested.
Classes from current login flow: WelcomeScreen, WelcomeScreenState, LoginScreen are reverted to their original forms, LoginErrorDialog is extracted to separate file so that it can be reused more easily.
Feature flag enterprise_login_enabled is created in this PR to be able to switch between old and new login flow.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@echoes-hq echoes-hq bot added the echoes/initiative: scale Enterprise Readiness Initiatives label Jan 22, 2025
@saleniuk saleniuk requested a review from yamilmedina January 22, 2025 13:23
Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

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

Great job!! looks good to me and can make us progress without waiting for BE.

Just raised a question, if we can make the initial destination dynamic as it is now, but based on the API version instead of compile time. Not to solve now, but problem for the near future.

navArgsDelegate = LoginNavArgs::class
)
@Composable
// this is a temporary solution because annotation argument "start" must be a compile-time constant
Copy link
Contributor

Choose a reason for hiding this comment

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

Good trick !

Question: can we maintain this in the future ? Mainly because we will need to resolve this not by compile time, but with API version based. If the backend is v8+ then new login flow. If not, the old/current flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, so in short: yes, we can do that!

In that case we would need to create a small dedicated ViewModel that uses AuthServerConfigProvider and inject it into composable to determine the login flow version to use and this way we create a screen destination that works as a login flow "chooser", but we would need to create such composable "chooser" for the "welcome" and "login" screen (sometimes we directly open "login" screen, e.g. when migration requires the user to log in).

@saleniuk saleniuk requested review from a team, alexandreferris, borichellow, vitorhugods, ohassine and emmaoke-w and removed request for a team January 22, 2025 16:46
@saleniuk saleniuk merged commit 0e83db0 into epic/new-sso-login-flow Jan 23, 2025
7 of 8 checks passed
@saleniuk saleniuk deleted the feat/newlogin-feature-flag branch January 23, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/initiative: scale Enterprise Readiness Initiatives size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants