Skip to content

[HOLD for payment 2024-08-07] [$250] IOU - Clicking back "on page not found" page takes you to a workspace page #44924

Closed

Description

@lanitochka17

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.4-5
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
Email or phone of affected tester (no customers): dave0123seife+stest@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to a 1:1 Conversation. Make sure your seeing both account at the same time
  2. As user A request money from User B
  3. As user A go the IOU report that was just created and click on the Plus button to bring the menu
  4. While the menu is still open Go to User B and Pay the expense
  5. As user A click on "submit expense" on the menu that was opened in step 3.
  6. Notice the error page is shown.
  7. Click the back button found on the error page

Expected Result:

Clicking back takes you to the IOU report page

Actual Result:

Clicking back "on page not found" page takes you to a workspace page

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6534018_1720180967660.ex_IOU_issue.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019f96054ddd649966
  • Upwork Job ID: 1811060426930703182
  • Last Price Increase: 2024-07-10
  • Automatic offers:
    • nkdengineer | Contributor | 103146401
Issue OwnerCurrent Issue Owner: @miljakljajic

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 5, 2024
  2. melvin-bot commented on Jul 5, 2024

    @melvin-bot

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

  3. nyomanjyotisa commented on Jul 5, 2024

    @nyomanjyotisa
    Member

    Proposal

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

    IOU - Clicking back "on page not found" page takes you to a workspace page

    What is the root cause of that problem?

    <AccessOrNotFoundWrapper
    reportID={reportID}
    iouType={iouType}
    policyID={policy?.id}
    accessVariants={[CONST.IOU.ACCESS_VARIANTS.CREATE]}
    allPolicies={allPolicies}
    >

    We pass policyID on AccessOrNotFoundWrapper for the IOURequestStartPage

    onBackButtonPress={() => Navigation.goBack(policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}

    Because the policyID exist it will navigate to ROUTES.WORKSPACE_PROFILE.getRoute(policyID) on back button press

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

    Remove the policyID on AccessOrNotFoundWrapper for the IOURequestStartPage so it will navigate back

           <AccessOrNotFoundWrapper
                reportID={reportID}
                iouType={iouType}
                accessVariants={[CONST.IOU.ACCESS_VARIANTS.CREATE]}
                allPolicies={allPolicies}
            >
    

    RESULT

    2024-07-06.00-56-27.mp4

    What alternative solutions did you explore? (Optional)

  4. ShridharGoel commented on Jul 6, 2024

    @ShridharGoel
    Contributor

    Proposal

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

    IOU - Clicking back on "Page not found" page takes to a workspace page.

    What is the root cause of that problem?

    AccessOrNotFound page leads to workspace page if policy ID is passed.

    onBackButtonPress={() => Navigation.goBack(policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}

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

    Add shouldOpenProfileOnBackPress as a prop in AccessOrNotFoundWrapper:

    Update onBackButtonPress:

    onBackButtonPress={() => Navigation.goBack(shouldOpenProfileOnBackPress && policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}
    

    We also need to discuss if we want to keep shouldOpenProfileOnBackPress as true by default or should we keep it as false. If we want to keep the existing flow in other places, we will need to make it's default value as true.

    function AccessOrNotFoundWrapper({accessVariants = [], fullPageNotFoundViewProps, shouldBeBlocked, shouldOpenProfileOnBackPress = true, ...props}: AccessOrNotFoundWrapperProps)
    

    shouldOpenProfileOnBackPress will be passed to PageNotFoundFallback.

    Now, in IOURequestStartPage, pass it as false:

    <AccessOrNotFoundWrapper
        reportID={reportID}
        iouType={iouType}
        policyID={policy?.id}
        accessVariants={[CONST.IOU.ACCESS_VARIANTS.CREATE]}
        allPolicies={allPolicies}
        shouldOpenProfileOnBackPress={false}
    >
    

    We might need to pass shouldOpenProfileOnBackPress from multiple places depending on what we are keeping as the default value.

  5. nkdengineer commented on Jul 8, 2024

    @nkdengineer
    Contributor

    Proposal

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

    Clicking back "on page not found" page takes you to a workspace page

    What is the root cause of that problem?

    We have two bugs here

    1. When the expense is paid, the submit expense options doesn't disappear immediately. The RCA is we compare the menuItems prop wrong here so when it's changed, the component doesn't re-render.

    !lodashIsEqual(prevProps.menuItems, nextProps.menuItems) &&

    1. Clicking back "on page not found" page takes you to a workspace page
      . The RCA is in AccessOrNotFoundWrapper, we always go back to policy page when we click on back button if the policyID exists.

    onBackButtonPress={() => Navigation.goBack(policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}

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

    When the expense is paid, the submit expense options doesn't disappear immediately

    1. For the first bug we should update the compare for menuItems correctly
    lodashIsEqual(prevProps.menuItems, nextProps.menuItems) && 
    

    !lodashIsEqual(prevProps.menuItems, nextProps.menuItems) &&

    Clicking back "on page not found" page takes you to a workspace page

    1. This component is used in both IOURequestStartPage and policy pages.

    onBackButtonPress={() => Navigation.goBack(policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}

    We can add an extra prop in PageNotFoundFallback like isMoneyRequest

    function PageNotFoundFallback({policyID, shouldShowFullScreenFallback, fullPageNotFoundViewProps}: PageNotFoundFallbackProps) {

    And update the condition here to not go back to policy profile page if we're in money request flow

    () => Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)
    

    onBackButtonPress={() => Navigation.goBack(policyID ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}

    And then pass isMoneyRequest={isMoneyRequest} to PageNotFoundFallback here

    What alternative solutions did you explore? (Optional)

  6. melvin-bot commented on Jul 8, 2024

    @melvin-bot

    @miljakljajic Whoops! This issue is 2 days overdue. Let's get this updated quick!

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 10, 2024
  8. melvin-bot commented on Jul 10, 2024

    @melvin-bot
  9. changed the title [-]IOU - Clicking back "on page not found" page takes you to a workspace page[/-] [+][$250] IOU - Clicking back "on page not found" page takes you to a workspace page[/+] on Jul 10, 2024
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 10, 2024
  11. melvin-bot commented on Jul 10, 2024

    @melvin-bot

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

  12. 18 remaining items

  13. changed the title [-][$250] IOU - Clicking back "on page not found" page takes you to a workspace page[/-] [+][HOLD for payment 2024-08-07] [$250] IOU - Clicking back "on page not found" page takes you to a workspace page[/+] on Jul 31, 2024
  14. melvin-bot commented on Jul 31, 2024

    @melvin-bot

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

  15. melvin-bot commented on Jul 31, 2024

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2024-08-07. 🎊

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

  16. melvin-bot commented on Jul 31, 2024

    @melvin-bot

    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:

    • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
    • [@thesahindia] 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:
    • [@thesahindia] 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:
    • [@thesahindia] Determine if we should create a regression test for this bug.
    • [@thesahindia] 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.
    • [@miljakljajic] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. miljakljajic commented on Aug 7, 2024

    @miljakljajic
    Contributor

    @thesahindia is owed 250 for their work reviewing this issue

  18. miljakljajic commented on Aug 7, 2024

    @miljakljajic
    Contributor

    @thesahindia do we need a regression test for this issue?

    @nkdengineer paid in upwork

  19. thesahindia commented on Aug 8, 2024

    @thesahindia
    Member

    We should add a test case, here are the steps -

    For actions menu -

    1. Login with account A and B on different devices or browsers
    2. As user A request money from User B > Go to that IOU report
    3. Click on "+" to open the actions menu
    4. Now use account B and pay the expense
    5. On account A screen wait for a few seconds
    6. Verify that the "submit expense" option disappear

    For clicking back "on page not found" page takes you to a workspace page -

    1. Login with account A and B on different devices or browsers
    2. As user A request money from User B > Go to that IOU report
    3. Click on "+" to open the actions menu
    4. Now use account B and pay the expense
    5. On account A quickly click on "submit expense"
    6. Wait for a few seconds, you will see the not found page
    7. Click at the back button
    8. Verify it takes you back to report screen
  20. miljakljajic commented on Aug 8, 2024

    @miljakljajic
    Contributor

    Thank you!

  21. thesahindia commented on Sep 10, 2024

    @thesahindia
    Member

    @miljakljajic, looks like we don't have a payment summary here. Could you please add one? I need it for getting the payment approved.

    Missed the comment! We already have it here.

  22. garrettmknight commented on Sep 11, 2024

    @garrettmknight
    Contributor

    $250 approved for @thesahindia based on this payment summary

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions