-
Notifications
You must be signed in to change notification settings - Fork 575
Fix #482: Remove default admin for onboarding V2 (3/12) #5968
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
base: create-admin-intro
Are you sure you want to change the base?
Conversation
|
Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Coverage ReportResultsNumber of files assessed: 8 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
|
@BenHenning, PTAL. This is probably the smallest PR in the entire project 😁. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adhiamboperes! Just a few comments--PTAL.
| message ProfileChooserActivityParams { | ||
| // TODO(#482): Remove once the default admin profile has been removed. | ||
| // The nickname associated with a newly created profile. | ||
| string profile_nickname = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be marked as reserved probably, just for posterity (since the interoperability risk is low).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not need to be reserved because it has never actually been used in logs. I introduced it in one of the earlier PRs for this project, so there is no risk to removing it completely. I noticed that I should have re-numbered the fields however, which I have now done.
| } | ||
|
|
||
| /** | ||
| * Deletes all app data by removing all profile,s resetting onboarding state, and closing the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Deletes all app data by removing all profile,s resetting onboarding state, and closing the app. | |
| * Deletes all app data by removing all profile's resetting onboarding state, and closing the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
| private fun deleteAppData() { | ||
| profileManagementController.deleteAllProfiles().toLiveData().observe(fragment) { | ||
| // Reset onboarding so the app starts fresh. | ||
| appStartupStateController.resetOnboardingState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth verifying via test that this step happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Reminder check the checkboxes on the PR description as well. Other than that, super cool to see an issue from 2019 get resolved! :D |
|
@BenHenning, PTAL. |
Coverage ReportResultsNumber of files assessed: 9 Passing coverageFiles with passing code coverage
Exempted coverageFiles exempted from coverage
|
|
Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
|
Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |

Explanation
Fix #482
In the legacy onboarding flow, the admin profile is hardcoded into the profile chooser screen. In V2 of the onboarding flow, an admin user creates their profile during onboarding. This makes the hardcoded profile redundant, and this PR removes it.
Main Changes
Gating
addProfile()profileManagementController.addProfile()is now gated behind theenableOnboardingFlowV2flag.Cleanup of
profileNicknameprofileNicknameargument (introduced in a previous PR to ensure the created profile had the correct display name) is no longer needed.Fix for App Data Reset Edge Case
resetOnboardingStatehas been added inAppStartupStateController.ktto reset the onboarding state.Considered Approaches
There were multiple possible solutions for handling the reset logic:
(a) UI-Layer Reset
alreadyOnboardedApptofalseand call the function in the UI layer.ProfileLoginFragmentTest.kt.(b) Domain-Layer Reset
alreadyOnboardedApptofalseinsideprofileManagementController.deleteAllProfiles().deleteAllProfiles().(c) Refactor to Remove
alreadyOnboardedAppenableAppAndOsDeprecationfeature flag.onboardingFlowStore, adding complexity.Option (a) was chosen because it:
Essential Checklist
For UI-specific PRs only