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(onboarding): Keyless Backup Setup Fail in Onboarding Flow #5537

Merged
merged 11 commits into from
Jun 14, 2024

Conversation

finnian0826
Copy link
Contributor

@finnian0826 finnian0826 commented Jun 12, 2024

Description

Added origin param to decide whether CAB flow was entered from Onboarding or Settings. The first screen that this param is passed to is SignInWithEmail, since that is the first CAB screen that is hit during onboarding.

Test plan

Unit tests added.

Manual:
Screen:
Simulator Screenshot - iPhone 14 Pro - 2024-06-12 at 12 31 28

Recovery phrase:

recovery.mp4

Skip:

skip.mp4

Related issues

Backwards compatibility

Yes

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.44%. Comparing base (880f24d) to head (6d71878).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5537   +/-   ##
=======================================
  Coverage   86.43%   86.44%           
=======================================
  Files         762      762           
  Lines       31425    31448   +23     
  Branches     5406     5416   +10     
=======================================
+ Hits        27161    27184   +23     
  Misses       4033     4033           
  Partials      231      231           
Files Coverage Δ
src/analytics/Events.tsx 100.00% <100.00%> (ø)
src/analytics/Properties.tsx 100.00% <ø> (ø)
src/keylessBackup/KeylessBackupIntro.tsx 95.55% <100.00%> (+0.10%) ⬆️
src/keylessBackup/KeylessBackupPhoneCodeInput.tsx 100.00% <ø> (ø)
src/keylessBackup/KeylessBackupPhoneInput.tsx 84.12% <100.00%> (ø)
src/keylessBackup/KeylessBackupProgress.tsx 99.31% <100.00%> (+0.10%) ⬆️
src/keylessBackup/SignInWithEmail.tsx 98.24% <100.00%> (ø)
src/onboarding/registration/ImportSelect.tsx 91.30% <100.00%> (+0.19%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 880f24d...6d71878. Read the comment docs.

@finnian0826 finnian0826 marked this pull request as ready for review June 12, 2024 19:24
@@ -265,6 +265,8 @@ interface KeylessBackupEventsProperties {
[KeylessBackupEvents.cab_progress_completed_continue]: undefined
[KeylessBackupEvents.cab_progress_failed_later]: undefined
[KeylessBackupEvents.cab_progress_failed_manual]: undefined
[KeylessBackupEvents.cab_progress_failed_manual_onboarding]: undefined
Copy link
Collaborator

@MuckT MuckT Jun 13, 2024

Choose a reason for hiding this comment

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

Can we pass an origin instead of having cab_progress_failed_manual and cab_progress_failed_manual_onboarding?

  [KeylessBackupEvents.cab_progress_failed_manual]: {
    origin: 'onboarding' | 'settings'
  }

@@ -78,6 +78,7 @@ function KeylessBackupPhoneInput({ route }: Props) {
navigate(Screens.KeylessBackupPhoneInput, {
keylessBackupFlow,
selectedCountryCodeAlpha2: countryCodeAlpha2,
origin: route.params.origin,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Can we destructure this from the route.params earlier in the file?

@@ -69,7 +76,7 @@ function KeylessBackupProgress({
if (route.params.keylessBackupFlow === KeylessBackupFlow.Restore) {
return <Restore />
} else {
return <Setup />
return <Setup navigatedFromSettings={navigatedFromSettings} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if something such as isOnboarding would be clearer; however, that also gets a bit muddled when someone could technically be onboarding to CAB from settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed what was being passed so now origin is being passed (to make analytics easier). Now navigatedFromSettings is computed in the Setup component, can change the name if you want but I'm not sure if changing would make any more clear?

Copy link

emerge-tools bot commented Jun 13, 2024

1 build had no size change

Name Version Download Change Install Change Approval
Celo (test)
org.celo.mobile.test
1.87.0 (152) 27.2 MB ⬇️ 900 B 64.6 MB - N/A

Celo (test) 1.87.0 (152)
org.celo.mobile.test

No changes to report


🛸 Powered by Emerge Tools

@@ -90,6 +91,7 @@ function KeylessBackupPhoneInput({ route }: Props) {
navigate(Screens.KeylessBackupPhoneCodeInput, {
keylessBackupFlow,
e164Number: phoneNumberInfo.e164Number,
origin: route.params.origin,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: suggestion

Suggested change
origin: route.params.origin,
origin,

@@ -69,7 +74,7 @@ function KeylessBackupProgress({
if (route.params.keylessBackupFlow === KeylessBackupFlow.Restore) {
return <Restore />
} else {
return <Setup />
return <Setup origin={route.params.origin} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this can also be destructured with an additional const { origin } = route.params in the code above.

Copy link
Collaborator

@MuckT MuckT left a comment

Choose a reason for hiding this comment

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

LGMT just some small nitpicks.

@finnian0826 finnian0826 added this pull request to the merge queue Jun 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 14, 2024
@MuckT MuckT added this pull request to the merge queue Jun 14, 2024
Merged via the queue into main with commit 9fb1a3a Jun 14, 2024
16 checks passed
@MuckT MuckT deleted the finnian0826/act-1222 branch June 14, 2024 03:06
Comment on lines +35 to +38
export enum KeylessBackupOrigin {
Onboarding = 'Onboarding',
Settings = 'Settings',
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: move this to keylessBackup/types since this is used in multiple places. This can potentially cause circular imports

github-merge-queue bot pushed a commit that referenced this pull request Jun 14, 2024
### Description

Addressing this comment:
#5537 (comment)

### Test plan

CI

### Related issues

- Fixes #ACT-1222

### Backwards compatibility

Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [X] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
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

3 participants