App icon indicating copy to clipboard operation
App copied to clipboard

Expensify Card - Back button on issue card page returns to Bank account verified page

Open lanitochka17 opened this issue 1 year ago • 10 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.56-3 Reproducible in staging?: Y Reproducible in production?: N/A Unable to check If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card
  3. Click Issue new card
  4. Add a bank account
  5. Dismiss the RHP
  6. Click Issue new account
  7. Select the added bank account
  8. On Bank account verified page, click Got it
  9. On Issue card page, click RHP back button

Expected Result:

The RHP will be dismissed

Actual Result:

App returns to Bank account verified page

Workaround:

Unknown

Platforms:

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

  • [ ] Android: Standalone
  • [x] Android: HybridApp
  • [x] Android: mWeb Chrome
  • [ ] iOS: Standalone
  • [x] iOS: HybridApp
  • [x] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/9b4080e6-1e88-4c74-825a-01b83e605de1

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @situchan

lanitochka17 avatar Nov 01 '24 17:11 lanitochka17

Triggered auto assignment to @thienlnam (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Nov 01 '24 17:11 melvin-bot[bot]

💬 A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Nov 01 '24 17:11 melvin-bot[bot]

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Nov 01 '24 17:11 github-actions[bot]

Proposal

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

Back button on issue card page returns to Bank account verified page

What is the root cause of that problem?

When user press Got it we simply navigate to next page rather then dismissing the current modal https://github.com/Expensify/App/blob/b9ec75ae4977b6df52912dae4cdab53ab7973701/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardBankAccounts.tsx#L154

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

We should also dismiss the modal before navigating here. We can do something like this

   onPress={() => {
                                Navigation.dismissModal();
                                Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW.getRoute(policyID)); 
                            }}

It's a similar approach that we also use in other places

What alternative solutions did you explore? (Optional)

We can also use goBack() before navigating to WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW

Nodebrute avatar Nov 01 '24 17:11 Nodebrute

I'm not sure if this is actually a bug or not - adding external so we can get a BZ assigned to determine whether we should fix this or not

thienlnam avatar Nov 01 '24 18:11 thienlnam

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

melvin-bot[bot] avatar Nov 01 '24 18:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 01 '24 18:11 melvin-bot[bot]

Triggered auto assignment to @OfstadC (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.

melvin-bot[bot] avatar Nov 01 '24 18:11 melvin-bot[bot]

Possibly no longer an issue https://expensify.slack.com/archives/C01GTK53T8Q/p1730482621189069

thienlnam avatar Nov 01 '24 22:11 thienlnam

Proposal

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

App returns to Bank account verified page

What is the root cause of that problem?

  • When users press on "Got it" button, they just navigate to a new screen without removing the current screen from stack: https://github.com/Expensify/App/blob/b9ec75ae4977b6df52912dae4cdab53ab7973701/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardBankAccounts.tsx#L154 so when clicking on back button on issue card page, the bank account verified page appears again.

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

  • When clicking on "Got it", we should replace the current screen by the issue new card screen. To do it, just need to navigate with type: UP in this:
                                Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW.getRoute(policyID), CONST.NAVIGATION.TYPE.UP); 

What alternative solutions did you explore? (Optional)

daledah avatar Nov 02 '24 05:11 daledah

@OfstadC, @thienlnam, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 04 '24 18:11 melvin-bot[bot]

~@daledah's proposal~ @Nodebrute's proposal looks good. There's one more verifying step after https://github.com/Expensify/App/pull/51407 so the repro step should be updated a bit. 🎀👀🎀 C+ reviewed

situchan avatar Nov 04 '24 19:11 situchan

Current assignee @thienlnam is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar Nov 04 '24 19:11 melvin-bot[bot]

@situchan, I'd like to point out that we rarely use CONST.NAVIGATION.TYPE.UP in our codebase—only in two places outside of goBack. For cases like this, we generally use goBack or dismissModal, which is the more common approach throughout our app. Since goBack itself uses CONST.NAVIGATION.TYPE.UP, I don’t believe @daledah's proposal is fundamentally different from mine; it’s just another way to achieve the same result. https://github.com/Expensify/App/blob/4aa007bf405bd11b275bf3e599817e192fa2b249/src/libs/Navigation/Navigation.ts#L245 https://github.com/Expensify/App/blob/4aa007bf405bd11b275bf3e599817e192fa2b249/src/libs/Navigation/Navigation.ts#L235

and sometimes CONST.NAVIGATION.TYPE.UP also uses dismissModal under the hood https://github.com/Expensify/App/blob/4aa007bf405bd11b275bf3e599817e192fa2b249/src/libs/Navigation/linkTo/index.ts#L122-L124

cc: @thienlnam

Nodebrute avatar Nov 04 '24 19:11 Nodebrute

There's one more verifying step after #51407 so the repro step should be updated a bit.

Actually, the user will either see Got it or One more step, as these are different states displayed on the same page.

https://github.com/Expensify/App/blob/b9ec75ae4977b6df52912dae4cdab53ab7973701/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardBankAccounts.tsx#L120 https://github.com/Expensify/App/blob/b9ec75ae4977b6df52912dae4cdab53ab7973701/src/pages/workspace/expensifyCard/WorkspaceExpensifyCardBankAccounts.tsx#L141

Nodebrute avatar Nov 04 '24 19:11 Nodebrute

@situchan Another very similar flow in our app is the upgrade process, where after pressing Got it to open the NetSuite page, we first dismiss the modal and then navigate to the next page. https://github.com/Expensify/App/blob/4aa007bf405bd11b275bf3e599817e192fa2b249/src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx#L52-L53

https://github.com/user-attachments/assets/cb00c3b2-a158-48b2-8d6c-b2aa1a07453e

Nodebrute avatar Nov 04 '24 20:11 Nodebrute

@Nodebrute sorry I didn't realize that there was a proposal before making External. I reviewed only @daledah's proposal. And yes, your proposal also looks good. Since you're the first, you can be assigned. cc: @thienlnam

situchan avatar Nov 04 '24 20:11 situchan

@situchan Thank you so much.

Nodebrute avatar Nov 04 '24 20:11 Nodebrute

Asking to have this retested here Based on this - https://expensify.slack.com/archives/C01GTK53T8Q/p1730487824713359?thread_ts=1730482621.189069&cid=C01GTK53T8Q

OfstadC avatar Nov 04 '24 22:11 OfstadC

As I mentioned previously, my approach is widely used across the app. For example, in this similar case #51883, this pattern was applied. I can provide many more examples if needed.

Regarding transitions, using the UP transition can be misleading for users. It creates the impression that a new screen appears on top of the previous one, but pressing the back button reveals there's no screen underneath, which can feel confusing. So, I don't believe my transition is incorrect.

Nodebrute avatar Nov 04 '24 23:11 Nodebrute

As I mentioned previously, my approach is widely used across the app. For example, in this similar case https://github.com/Expensify/App/issues/51883#issuecomment-2455613641, this pattern was applied. I can provide many more examples if needed.

To effectively resolve any issue, we should focus on establishing the correct root cause analysis (RCA) and verifying that the solution addresses the current bug, rather than relying solely on whether similar solutions are used elsewhere.

Regarding transitions, using the UP transition can be misleading for users. It creates the impression that a new screen appears on top of the previous one, but pressing the back button reveals there's no screen underneath, which can feel confusing. So, I don't believe my transition is incorrect.

Let’s wait for the internal and C+ review on the correct behavior in this comment.

daledah avatar Nov 04 '24 23:11 daledah

To solve any issue properly, I think we should not depend on whether the solution is used in other places, but based on the correct RCA and verify whether it fixes the currenct bug.

Yes, I understand this is important, I’ve also verified that there are no regressions😁 As I mentioned here, I don’t believe @daledah's proposal is fundamentally different from mine; it’s simply another approach to achieve the same outcome. The behavior @daledah is mentioning can still be achieved using goBack.

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

Another instance where we encountered a similar issue, C+'s comment here: https://github.com/Expensify/App/issues/44506#issuecomment-2197273835

@situchan's decision:https://github.com/Expensify/App/issues/51883#issuecomment-2455557564

cc: @thienlnam

Nodebrute avatar Nov 05 '24 01:11 Nodebrute

Agree with @Nodebrute.

We can also use goBack() before navigating to WORKSPACE_EXPENSIFY_CARD_ISSUE_NEW

The same approach was used in https://github.com/Expensify/App/pull/44712

situchan avatar Nov 05 '24 05:11 situchan

@daledah yes, I already checked it. You wanna find and fix all instances throughout the app then?

situchan avatar Nov 05 '24 05:11 situchan

You wanna find and fix all instances throughout the app then?

I am not sure that we can cover all other cases in this issue, just want to proposal the correct approach for this issue, and then improve other places in future.

In my opinion, if we want to follow the approach we've used elsewhere, we can proceed with your selected proposal.

However, if the goal is to resolve the screen transition animation issue (where clicking 'Got it' causes the screen to swipe to the right, giving the appearance of going back), then my proposal could be a better fit.

https://github.com/user-attachments/assets/d5eda1d4-8c62-4016-a305-ac6f9fc50af5

Thanks for your feedback.

daledah avatar Nov 05 '24 06:11 daledah

Bug is still reproducible

https://github.com/user-attachments/assets/4a6778b9-dcf5-4055-80fd-246f900a76a3

kavimuru avatar Nov 05 '24 13:11 kavimuru

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

melvin-bot[bot] avatar Nov 05 '24 17:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 05 '24 17:11 melvin-bot[bot]

Upwork job price has been updated to $125

melvin-bot[bot] avatar Nov 05 '24 17:11 melvin-bot[bot]

Adjusting bounty as this is a simple bug

thienlnam avatar Nov 05 '24 17:11 thienlnam