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

[Guided Setup: Stage 3] Send the Onboarding Message After Sign-In #46052

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

cdOut
Copy link
Contributor

@cdOut cdOut commented Jul 23, 2024

Details

Added logic for sending onboarding messages through concierge after sign-in through a magic link sent via email for multiple cases.

Fixed Issues

$ #45044
PROPOSAL:

Tests

Workspace Non-admin:

  1. On the first account create or use an existing worspace
  2. Add a member using an email add an account that you know doesn't exist yet
  3. Make sure the account you've invited is set as just a Member
  4. Proceed to your email and press on the link on the bottom of the invitation email you've received
  5. Confirm that that a Concierge message appears and it shows the correct content, as well as an onboarding video.

Workspace Admin:

  1. On the first account create or use an existing worspace
  2. Add a member using an email add an account that you know doesn't exist yet
  3. Press on the newly invited user and make sure that his role is set to Admin
  4. Proceed to your email and press on the link on the bottom of the invitation email you've received
  5. Confirm that that a Concierge message appears and it shows the correct content, as well as an onboarding video.

DM / Group Chat:

  1. On the first account create or use an existing DM or Group Chat
  2. Add a member using an email add an account that you know doesn't exist yet, in the case of the room you can add by mentioning the user
  3. Proceed to your email and press on the link on the bottom of the invitation email you've received
  4. Confirm that that a Concierge message appears and it shows the correct content, as well as an onboarding video. Make sure the Start a chat is checked off & struck through.

User-created Room:

  1. On the first account create or use an existing user-created room
  2. Add a member using an email add an account that you know doesn't exist yet, do it by mentioning the gmail in the room chat
  3. Proceed to your email and press on the link on the bottom of the invitation email you've received
  4. Confirm that that a Concierge message appears and it shows the correct content, as well as an onboarding video.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • 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

MacOS: Chrome / Safari

Workspace Admin

WEB.WORKSPACE.ADMIN.low.res.mov

Workspace Non-Admin

WEB.WORKSPACE.NON-ADMIN.low.res.mov

@cdOut cdOut marked this pull request as ready for review July 29, 2024 07:38
@cdOut cdOut requested a review from a team as a code owner July 29, 2024 07:38
@melvin-bot melvin-bot bot requested review from getusha and removed request for a team July 29, 2024 07:38
Copy link

melvin-bot bot commented Jul 29, 2024

@getusha Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@trjExpensify
Copy link
Contributor

👋 @getusha can you review this one today, please? Thanks!

@getusha
Copy link
Contributor

getusha commented Jul 29, 2024

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (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
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Workspace Admin

screen-recording-2024-09-26-at-45054-in-the-afternoon_GAIw0CSx.mp4

Workspace Non-Admin

Screen.Recording.2024-09-26.at.4.58.14.in.the.afternoon.mov
Android: mWeb Chrome

Workspace Admin

Screenshot 2024-09-26 at 4 38 34 in the afternoon

Workspace Non-Admin

Screenshot 2024-09-26 at 4 24 59 in the afternoon

iOS: Native

Workspace Admin

Screen.Recording.2024-09-26.at.5.11.22.in.the.afternoon.mov
iOS: mWeb Safari

Workspace Admin

Screenshot 2024-09-26 at 4 33 56 in the afternoon

Workspace Non-Admin

Screenshot 2024-09-26 at 4 31 35 in the afternoon

MacOS: Chrome / Safari

Workspace Non-Admin

screen-recording-2024-09-25-at-101910-in-the-morning_QRIpKXNH.mp4

Workspace Admin

Screen.Recording.2024-09-25.at.6.37.21.in.the.evening.mov

User-created Room / DM / Group Chat:

Screenshot 2024-09-25 at 9 47 50 at night

MacOS: Desktop

Workspace Non-Admin

Screenshot 2024-09-26 at 4 29 46 in the afternoon

User-created Room / DM / Group Chat:

Screenshot 2024-09-26 at 4 32 30 in the afternoon

src/CONST.ts Outdated
@@ -4297,7 +4332,7 @@ const CONST = {
type: 'meetGuide',
autoCompleted: false,
title: 'Meet your setup specialist',
description: ({adminsRoomLink}: {adminsRoomLink: string}) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kosmydel who originally worked on this wanted to have better typescript checks for the message types so this has been removed in favor of adding a satisfies Record<OnboardingPurposeType, OnboardingMessageType> to the whole message CONST definition just to be clear that the values defined there are correct.

src/libs/actions/Report.ts Outdated Show resolved Hide resolved
src/libs/actions/Report.ts Outdated Show resolved Hide resolved
src/libs/actions/Report.ts Outdated Show resolved Hide resolved
src/libs/actions/Report.ts Outdated Show resolved Hide resolved
@getusha
Copy link
Contributor

getusha commented Jul 30, 2024

Not able to get an invitation email after inviting new member to a workspace, is it working for you? @cdOut

@cdOut
Copy link
Contributor Author

cdOut commented Jul 30, 2024

@getusha I've cleaned up the code after your review.

I did not encounter an issue with receiving the invitation emails, no. Did you check after by logging into the invited account if they are even being properly added to said workspace?

@trjExpensify
Copy link
Contributor

@getusha let me know what email address you used to invite and invited.

@getusha
Copy link
Contributor

getusha commented Jul 30, 2024

Automated Tests

@cdOut Is this planned to be worked on separately? #45044

And lets make sure we are covering the cases in the feature description in test steps.

@cdOut
Copy link
Contributor Author

cdOut commented Jul 30, 2024

Automated Tests
@cdOut Is this planned to be worked on separately? #45044

@deetergp should the automated tests for it be added here or handled separately?

And lets make sure we are covering the cases in the feature description in test steps.

Also I'm fairly sure all the cases are handled in test steps, I've separated them into three different sections.

@getusha
Copy link
Contributor

getusha commented Sep 25, 2024

Sorry, attached a wrong video. this is the link.

https://email.expensify.com/c/eJxUzj1v8jAQAOBfc9ledD47djJ44AW5Q7-ktlMX5CRncEVilFyA_vtK3bo_wzP41lmLFXvlyFGNRqnq5LVLjU7ExpKhruvjEFNnmNoY2ekhVdkTksGWanTG1mrDUWvSQ9v0aN2gEAzy_cLTktP3pi9jdfYnkcsCegsUgMLEt80fARSuQEE12qGyNVDYPu8fXx-etp-gA9-zfBTQe6AwAwVCdI2m1lpslXKumv2RZR14ybIC_Z_49i8aMHgcYz7_DsS_FMkp91FymQ5vfCmzHHbrImV8X7sv7mVXxpEnqa6efgIAAP__DjdVUg

I think it should've been something like this to work:
https://new.expensify.com/v/18370080/CNZAQKIJK?exitTo=/r/7302026878763812

@trjExpensify
Copy link
Contributor

This PR hasn't touched emails has it? 🤔

@cdOut
Copy link
Contributor Author

cdOut commented Sep 25, 2024

This PR hasn't touched emails has it? 🤔

It has not, but for whatever reason we send two types of links when inviting new users. One is in the form of https://new.expensify / https://staging.new.expensify and the other is https://email.expensify. I'm not sure why that is, @deetergp could probably answer that one, but they essentially redirect to the same flow in the app. The only problem is that the email variant isn't modifiable to test on the dev branch (as in swapping staging.new.expensify to dev.new.expensify.com:8082 for example, we cannot do that for the email variant) so that's why it's problematic here.

Still, this doesn't block testing and at best is just a slight inconvenience. My advice would be to swap to use staging backend for testing and just retry until you get a valid replacable url for local dev.

@getusha
Copy link
Contributor

getusha commented Sep 26, 2024

@cdOut I signed in via an invite link on Android native, but the video isn't loading. Is this something we can fix here?

  1. Invite a user that doesn't exist yet
  2. Change the role to admin
  3. Open the invite link on android npx uri-scheme open "new-expensify://v/18376702/VDLKQYZTW\?exitTo\=/r/3948290673863711" --android or just directly sign-in using the email address

@trjExpensify
Copy link
Contributor

If you organically sign-up and choose "Manage my team's expenses" - does the video load in that flow on Android native?

@getusha
Copy link
Contributor

getusha commented Sep 26, 2024

If you organically sign-up and choose "Manage my team's expenses" - does the video load in that flow on Android native?

Yes

@cdOut
Copy link
Contributor Author

cdOut commented Sep 26, 2024

I signed in via an invite link on Android native, but the video isn't loading. Is this something we can fix here?

@getusha Would you be able to get the cURL and requestID so Scott could check what kinda data is being sent back over to you?

@deetergp
Copy link
Contributor

@cdOut Do you happen to know which flows send which URLs? I'm not sure what those email. URLs are about.

@getusha Is the video failing to load only on Android? Does it show in that same flow on other platforms?

@cdOut
Copy link
Contributor Author

cdOut commented Sep 30, 2024

@deetergp all flows send both types of urls, this isn't flow-dependant.

@getusha could you specify if this only happens on android and check whether the specific flow you used on android works for desktop / web or does it also return broken video? Also try completing the tasks, do they complete successfully when pressing the checkbox or are they also broken? Is that just a problem with the video?

@getusha
Copy link
Contributor

getusha commented Sep 30, 2024

@getusha Is the video failing to load only on Android? Does it show in that same flow on other platforms?

I was also able to reproduce on iOS. i'll check on other platforms as well.

@cdOut
Copy link
Contributor Author

cdOut commented Sep 30, 2024

@getusha is that happening for one specific case or just in general? What are the steps to reproduce?

@getusha
Copy link
Contributor

getusha commented Sep 30, 2024

@cdOut happens for if the account role is set to admin.
here are the steps #46052 (comment)

@getusha
Copy link
Contributor

getusha commented Sep 30, 2024

@getusha could you specify if this only happens on android and check whether the specific flow you used on android works for desktop / web or does it also return broken video? Also try completing the tasks, do they complete successfully when pressing the checkbox or are they also broken? Is that just a problem with the video?

Works well on web, and it seems like it's broken it failed several times after checking the tasks off.

Screen.Recording.2024-09-30.at.9.40.17.at.night.mov

@cdOut
Copy link
Contributor Author

cdOut commented Oct 2, 2024

@getusha Could you retrieve the requestID of openReport call which sends over the guidedSetupData? And is the LateOnyxUpdate from API returned correctly?

@getusha
Copy link
Contributor

getusha commented Oct 3, 2024

@cdOut

DEBUG [info] [Network] Finished API request in 528ms - {"command":"OpenReport","jsonCode":200,"requestID":"8ccce7342d46973c-FRA"} {"request": {"command": "OpenReport", "cursorID": "", "data": {"accountIDList": "", "apiRequestType": "write", "canCancel": true, "clientLastReadTime": "2024-10-03 12:23:04.406", "emailList": "", "parentReportActionID": "-1", "pusherSocketID": "783029.79018", "reportActionID": "", "reportID": "94145616603358", "shouldRetry": true}, "failureData": [[Object]], "isPaginated": true, "resourceID": "94145616603358", "successData": [[Object], [Object]]}, "response": {"hasOlderActions": false, "jsonCode": 200, "onyxData": [[Object], [Object], [Object]], "requestID": "8ccce7342d46973c-FRA"}}

@getusha
Copy link
Contributor

getusha commented Oct 3, 2024

@cdOut are you not able to reproduce it?

@cdOut
Copy link
Contributor Author

cdOut commented Oct 24, 2024

@getusha all the issues we've had for the backend were resolved today, I've tested it on my end and it runs properly for all cases. Ready for your hopefully final re-test!

@deetergp
Copy link
Contributor

@getusha Please prioritize this review so we can get this bad boy merged 🙏

@getusha
Copy link
Contributor

getusha commented Oct 25, 2024

@cdOut this is the only message i am seeing from concierge

Screenshot 2024-10-25 at 12 31 20 in the afternoon

Screen.Recording.2024-10-25.at.12.20.58.in.the.afternoon.mov

@cdOut
Copy link
Contributor Author

cdOut commented Oct 25, 2024

this is the only message i am seeing from concierge

Alright let me take a look at it, any specific case?

@zfurtak
Copy link
Contributor

zfurtak commented Oct 28, 2024

hi @getusha, could you give a more specific scenario in which the issue occurred? 😊 So I can take care of this immediately, as @cdOut is ooo today and tomorrow 🔍

@cdOut
Copy link
Contributor Author

cdOut commented Oct 28, 2024

I've asked about the issue in this thread on slack, seems like it's a backend issue once again as we don't have any way of modifying the email messages on frontend.

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.

6 participants