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

[Onboarding - Stage 2] Onboarding Flow - enabled #39687

Merged

Conversation

filip-solecki
Copy link
Contributor

@filip-solecki filip-solecki commented Apr 5, 2024

Details

Fixed Issues

$ #39969
$ #39918
$ #39925
PROPOSAL:

Tests

  1. Log in as a new user
  2. Verify if new Onboarding modal shows up
  3. Input a name and a surname in the input fields, press continue button.
  4. Click on any of the displayed options and press continue.
  5. Verify that a video modal pops up with the app explanation video, if you're on desktop you should also get auto-navigated to the concierge report.
  6. Verify that you've received the correct message in the concierge report (it depends on the purpose you've chosen).

Note: To test with an existing user, you can initiate the flow from Settings > Troubleshoot > Onboarding Flow.

With the creation of a workspace (Track business expenses..., Manage my team’s...)

  1. Open the app with an entire new user.
  2. Verify that the "What do you want to do today?" modal appears.
  3. Select any tutorial.
  4. Click on "Continue".
  5. Verify that the "What’s your name?" modal appears.
  6. Enter any names.
  7. Click on "Continue".
  8. Verify that the "Where do you work?" modal appears.
  9. Enter any name.
  10. Click on "Continue".
  11. Verify that the app redirects to the home page.
  12. Open the Concierge chat.
  13. Verify that the app has generated the proper messages.
  14. Verify that the app has created a workspace with the previously entered name.
  15. Verify that attachment messages are replaced with videos, once the backend sends an update.

Without the creation of a workspace (others)

  1. Open the app with an entire new user.
  2. Verify that the "What do you want to do today?" modal appears.
  3. Select any tutorial.
  4. Click on "Continue".
  5. Verify that the "What’s your name?" modal appears.
  6. Enter any names.
  7. Click on "Continue".
  8. Verify that the app redirects to the home page.
  9. Open the Concierge chat.
  10. Verify that the app has generated the proper messages.
  11. Verify that attachment messages are replaced with videos, once the backend sends an update.
  • Verify that no errors appear in the JS console

Offline tests

  1. Log in as a new user
  2. Verify if new Onboarding modal shows up
  3. Force offline from Test tool menu
  4. Input a name and a surname in the input fields, press continue button.
  5. Click on any of the displayed options and press continue.
  6. Verify that animation shows instead of video

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android.mov
Android: mWeb Chrome
Android.chrome.mov
iOS: Native
ios.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web.1.mov
MacOS: Desktop
desktop.mov

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

The changes look good, lets get this tested well now 🚀

This comment has been minimized.

@mountiny
Copy link
Contributor

@hoangzinh are you able to do a round of testing on this one today please?

@hoangzinh
Copy link
Contributor

hoangzinh commented Apr 11, 2024

@filip-solecki I got an intermittent issue after sign up with a new account, sometimes it displays the onboarding modal, sometimes it shows infinite loading. Do you face same issue as me?

Screenshot 2024-04-11 at 16 31 04

@filip-solecki
Copy link
Contributor Author

filip-solecki commented Apr 11, 2024

Yes, I am investigating this issue, but if you have any idea don't hesitate to DM me or write here

@filip-solecki
Copy link
Contributor Author

Hmm, it is reproducible also on main in my case, how about you @hoangzinh ?

@hoangzinh
Copy link
Contributor

Hmm, it is reproducible also on main in my case, how about you @hoangzinh ?

I believe so. But I think it's better if we can fix it. I'm still trying to find root cause.

@hoangzinh
Copy link
Contributor

But this is something along the way I pickup

  1. It appears we're missing to include isFirstTimeNewExpensifyUser when check onboarding status ready
  • We use isFirstTimeNewExpensifyUser here
    if (!isFirstTimeNewExpensifyUser) {
    return;
    }
  • But we haven't included it here, so sometime the data isFirstTimeNewExpensifyUser is not ready yet
    function isAbleToDetermineOnboardingStatus({onAble, onNotAble}: DetermineOnboardingStatusProps) {
    const hasRequiredOnyxKeysBeenLoaded = [hasProvidedPersonalDetails, hasSelectedPurpose].every((value) => value !== undefined);

But even we do above, the issue is still reproducable.

@cdOut
Copy link
Contributor

cdOut commented Apr 11, 2024

@filip-solecki I got an intermittent issue after sign up with a new account, sometimes it displays the onboarding modal, sometimes it shows infinite loading. Do you face same issue as me?

@hoangzinh this issue has started to appear after the new architecture got merged into main, it doesn't only happen on this branch. Here's the steps to fix it:

  1. After downloading the dependencies with npm install you must run the clean command npm run clean
  2. When building for web / native web / desktop we need to clear site data by going into Inspect Element, into the Application tab and then into Storage. From this window we need to press the Clear site data button and then reload the site / desktop app.
  3. For native IOS / Android we also need to clear the app cache by going into Settings and Apps, selecting the Expensify app and clear it's cache data.

Here's where you can clear the data for web based apps:
Screenshot 2024-04-11 at 13 43 49

@hoangzinh
Copy link
Contributor

I think something went wrong with Onyx. OpenApp API returns a lot of data including personalDetailsList and isFirstTimeNewExpensifyUser, but it's not stored in Onyx. It causes our check here is false

function isAbleToDetermineOnboardingStatus({onAble, onNotAble}: DetermineOnboardingStatusProps) {
const hasRequiredOnyxKeysBeenLoaded = [hasProvidedPersonalDetails, hasSelectedPurpose].every((value) => value !== undefined);
if (hasRequiredOnyxKeysBeenLoaded) {
onAble?.();
} else {
onNotAble?.();
}
}

Screen.Recording.2024-04-11.at.21.58.00.mov

Copy link
Contributor

@hoangzinh hoangzinh left a comment

Choose a reason for hiding this comment

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

NAB:

/**
* Check if user dismissed modal and if report data are loaded
*/
function checkServerReady() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function checkServerReady() {
function checkServerDataReady() {

const hasRequiredOnyxKeysBeenLoaded = [isFirstTimeNewExpensifyUser, hasDismissedModal].every((value) => value !== undefined);

if (isLoadingReportData || !hasRequiredOnyxKeysBeenLoaded) {
function checkOnboardingReady() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function checkOnboardingReady() {
function checkOnboardingDataReady() {

* - Whether we are a first time new expensify user
* - Whether we have loaded all policies the server knows about
* - Whether we have loaded all reports the server knows about
* Check if onboarding object is not undefined so user can see onboarding modal
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Check if onboarding object is not undefined so user can see onboarding modal
* Check if onboarding data is ready in order to check if the user has completed onboarding or not

@hoangzinh
Copy link
Contributor

@filip-solecki When I completed onboarding and then re-login new account, the onboarding modal still shows again

Screen.Recording.2024-04-23.at.20.49.15.mov

@filip-solecki
Copy link
Contributor Author

It is not reproducible while using staging server, @mountiny is it expected?

@hoangzinh
Copy link
Contributor

@filip-solecki I found the root cause, if I fill either first name or last name as an empty string, the API CompleteGuidedSetup returns error

Screenshot 2024-04-23 at 23 13 52
Screenshot 2024-04-23 at 23 13 45

@filip-solecki
Copy link
Contributor Author

Hmm, we should probably fix validation to not accept empty strings, right?

@hoangzinh
Copy link
Contributor

I recall we allow to fill in empty strings on the personal details modal

@hoangzinh
Copy link
Contributor

Sorry I mean we can fill in a " " (space) as described in test step 10 in this PR description #37733

Screenshot 2024-04-23 at 23 30 08

Copy link
Contributor

@hoangzinh hoangzinh left a comment

Choose a reason for hiding this comment

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

Tested again and all goods except this bug #39687 (comment). I think it's not a blocker if we would like to merge this PR asap. Moreover, it should be fixed from BE, therefore I'm good with this PR. All your @mountiny @pecanoro

@melvin-bot melvin-bot bot requested a review from mountiny April 23, 2024 17:02
@mountiny
Copy link
Contributor

Sorry I mean we can fill in a " " (space) as described in test step 10 in this PR description

I think that instruction does not mean you can fill in name as whitespace, but that we should accept names like Edgar Alan Poe

function isOnboardingFlowCompleted({onCompleted, onNotCompleted}: HasCompletedOnboardingFlowProps) {
isOnboardingFlowStatusKnownPromise.then(() => {
// Remove once Stage 1 Onboarding Flow is ready
if (!isFirstTimeNewExpensifyUser) {
if (Array.isArray(onboarding) || onboarding?.hasCompletedGuidedSetupFlow === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB: Can you please add a comment to some follow up PR to explain that the onboarding is an empty array when the user hasnt completed the flow yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add in some follow up

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

One NAB, but changes are looking great, lets kick this off

@mountiny mountiny merged commit 23fe2e1 into Expensify:main Apr 23, 2024
17 checks passed
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.65-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@hoangzinh
Copy link
Contributor

Sorry I mean we can fill in a " " (space) as described in test step 10 in this PR description

I think that instruction does not mean you can fill in name as whitespace, but that we should accept names like Edgar Alan Poe

I don't think so @mountiny

Screenshot 2024-04-24 at 14 20 50

Based on above requirements in design doc, I think we would like to maintain the same behavior when we update personal details in user profile.

Screen.Recording.2024-04-24.at.14.22.25.mov

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 1.4.65-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Julesssss
Copy link
Contributor

Hey @pecanoro @mountiny. FYI deploying this before the Auth PR caused this issue on prod and staging. It looked pretty bad for new users.

Screenshot 2024-04-30 at 10 40 41

@pecanoro
Copy link
Contributor

pecanoro commented Apr 30, 2024

FYI deploying this before the Auth PR

@Julesssss What do you mean by this? The PR was tested so I am wondering how these were triggered. Or maybe something that was modified after new small changes were committed? Or is it happening only with some specific case?

@Julesssss
Copy link
Contributor

Julesssss commented Apr 30, 2024

I'm not certain, but it looks like this Auth PR should have been deployed before the full onboarding changes, as the above bug was deployed to staging/prod.

Perhaps this PR just modified the onboarding flow and the issue lies with this issue instead, which had the deploy blocker label removed. I'm not sure and don't really have time to investigate further.

@Ollyws
Copy link
Contributor

Ollyws commented Jul 14, 2024

We were able to skip onboarding by killing the app 43803, we fixed this in #44062

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.