Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.16k stars 2.65k forks source link

[HOLD for payment 2024-07-17] [$250] IOS - Transfer owner - App returns to empty screen when swiping right on success screen #44506

Closed lanitochka17 closed 4 days ago

lanitochka17 commented 3 weeks ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.2-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

Expected Result:

App will return to member profile page

Actual Result:

App returns to an empty Transfer owner screen

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/c98bc362-8ba4-4680-8b9e-97dd1a2f20cb

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01054e6abc7abcdf2c
  • Upwork Job ID: 1806448714527773045
  • Last Price Increase: 2024-06-27
  • Automatic offers:
    • c3024 | Reviewer | 102950095
Issue OwnerCurrent Issue Owner: @MitchExpensify / @MitchExpensify
Issue OwnerCurrent Issue Owner: @puneetlath / @MitchExpensify
melvin-bot[bot] commented 3 weeks ago

Triggered auto assignment to @MitchExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

lanitochka17 commented 3 weeks ago

@MitchExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

layacat commented 3 weeks ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

App returns to empty screen when swiping right on success screen

What is the root cause of that problem?

After we changed owner, we navigate user to screens based on the result screen in here: https://github.com/Expensify/App/blob/9d8e7feefd8e588d4a7bc8f53035fe0b924ad618/src/pages/workspace/members/WorkspaceOwnerChangeWrapperPage.tsx#L37-L47

While we still kept WorkspaceOwnerChangeWrapperPage in the stack, error will be empty if we swipe back from Success or Error screen. https://github.com/Expensify/App/blob/9d8e7feefd8e588d4a7bc8f53035fe0b924ad618/src/pages/workspace/members/WorkspaceOwnerChangeWrapperPage.tsx#L30.

And now this function will return all empty texts: https://github.com/Expensify/App/blob/9d8e7feefd8e588d4a7bc8f53035fe0b924ad618/src/libs/WorkspacesSettingsUtils.ts#L280-L285

That's the root cause.

What changes do you think we should make in order to solve the problem?

Add Navigation.goBack() right before we navigating user to success or error screen in here and here

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

melvin-bot[bot] commented 3 weeks ago

πŸ“£ @layacat! πŸ“£ Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
melvin-bot[bot] commented 3 weeks ago

Job added to Upwork: https://www.upwork.com/jobs/~01054e6abc7abcdf2c

melvin-bot[bot] commented 3 weeks ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (External)

nkdengineer commented 3 weeks ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

App returns to an empty Transfer owner screen

What is the root cause of that problem?

When we go to the success or error page, we navigate to this page so the WorkspaceOwnerChangeWrapperPage still present in the navigation stack.

https://github.com/Expensify/App/blob/1d607acab9c47f2e0da4e8c85de5d90e2d47c11b/src/pages/workspace/members/WorkspaceOwnerChangeWrapperPage.tsx#L39

https://github.com/Expensify/App/blob/1d607acab9c47f2e0da4e8c85de5d90e2d47c11b/src/pages/workspace/members/WorkspaceOwnerChangeWrapperPage.tsx#L45

And then when we swiping, this page appears with empty because the check is complete now.

https://github.com/Expensify/App/blob/1d607acab9c47f2e0da4e8c85de5d90e2d47c11b/src/pages/workspace/members/WorkspaceOwnerChangeCheck.tsx#L36-L39

What changes do you think we should make in order to solve the problem?

We can use navigate with type is up here so the WorkspaceOwnerChangeWrapperPage can be removed from the navigation stack.

if (!policy.errorFields && policy.isChangeOwnerFailed) {
    // there are some errors but not related to change owner flow - show an error page
    Navigation.navigate(ROUTES.WORKSPACE_OWNER_CHANGE_ERROR.getRoute(policyID, accountID), CONST.NAVIGATION.TYPE.UP);
    return;
}

if (!policy?.errorFields?.changeOwner && policy?.isChangeOwnerSuccessful) {
    // no errors - show a success page
    Navigation.navigate(ROUTES.WORKSPACE_OWNER_CHANGE_SUCCESS.getRoute(policyID, accountID), CONST.NAVIGATION.TYPE.UP);
    return;
}

https://github.com/Expensify/App/blob/1d607acab9c47f2e0da4e8c85de5d90e2d47c11b/src/pages/workspace/members/WorkspaceOwnerChangeWrapperPage.tsx#L39

https://github.com/Expensify/App/blob/1d607acab9c47f2e0da4e8c85de5d90e2d47c11b/src/pages/workspace/members/WorkspaceOwnerChangeWrapperPage.tsx#L45

What alternative solutions did you explore? (Optional)

NA

c3024 commented 3 weeks ago

Are there some dummy card details that can be added at this step?

Screenshot 2024-06-28 at 2 05 36β€―PM
nkdengineer commented 3 weeks ago

@c3024 I commented this validate in PaymentCardForm, fill the form and then test this bug in the fail page.

// if (values.cardNumber && !ValidationUtils.isValidDebitCard(values.cardNumber.replace(/ /g, ''))) {
//     errors.cardNumber = translate(label.error.cardNumber);
// }
layacat commented 3 weeks ago

I tried to add CONST.NAVIGATION.TYPE.UP as type, but it doesn't work. We also have a similar fix by using goBack instead here: https://github.com/Expensify/App/pull/40395

c3024 commented 3 weeks ago

Thank you for your proposals.

Both solutions fix the issue.

Since the fix pertains to popping of screens in the same RightModalNavigator, as far as I know both goBack and UP work the same way.

As I see goBack much more commonly used in our repo than UP, I think we can go with @layacat 's proposal here.

πŸŽ€ πŸ‘€ πŸŽ€ C+ Reviewed

melvin-bot[bot] commented 3 weeks ago

Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 3 weeks ago

βœ… Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] commented 3 weeks ago

@puneetlath, @MitchExpensify, @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

MitchExpensify commented 3 weeks ago

@puneetlath do you agree with the decision to assign @layacat based on their proposal?

MitchExpensify commented 3 weeks ago

Not overdue, Melvin

melvin-bot[bot] commented 3 weeks ago

πŸ“£ @c3024 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 3 weeks ago

πŸ“£ @layacat You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] commented 1 week ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 1 week ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.5-13 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-17. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 week ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 1 week ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.6-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-22. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 week ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 6 days ago

Current assignee @puneetlath is eligible for the Bug assigner, not assigning anyone new.

MitchExpensify commented 6 days ago

Reassigning as I'm heading on parental leave πŸ™‡

c3024 commented 6 days ago

This is due for payment on 17-07. Date has been getting wrongly updated. I'll complete the checklist.

c3024 commented 6 days ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [x] [@c3024] The PR that introduced the bug has been identified. Link to the PR: #37869
  • [x] [@c3024] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/commit/4844b40e2fc66c86eb44004a8915849f54b1b82f#r144319754
  • [x] [@c3024] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: No discussion was started because this could not be identified earlier.
  • [x] [@c3024] Determine if we should create a regression test for this bug. Yes
  • [x] [@c3024] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Click on Avatar icon (Account Settings) > Workspaces > Click on a workspace > Members
  2. Click on Owner
  3. Click Transfer Owner
  4. Fill required fields and proceed to Success or Failure screen
  5. Click on browser back button/iOS swipe right/device back button (on Android)
  6. Verify that the Profile page of the member/owner in Step 2 appears
puneetlath commented 6 days ago

Regression test issue: https://github.com/Expensify/Expensify/issues/413387

@c3024 has been paid.

@layacat I've sent you an offer. Can you ping me here when you've accepted?

Also, can you follow the steps here so that in the future offers get automatically sent to you.

layacat commented 5 days ago

Accepted! Thanks!

puneetlath commented 4 days ago

All paid. Thanks everyone!