Skip to content

[HOLD for payment 2024-01-17] [$500] Request Money - If user reloads the IOU details page and go back, the same IOU page is shown #33205

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: 1.4.13-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

Pre-requisite: user must be logged in and be a member of a workspace.

  1. Go to workspace chat.
  2. Initiate an IOU request.
  3. On the details page, reload the page.
  4. Tap on back button

Expected Result:

Once the back button is pressed, the amount page should be shown

Actual Result:

The IOU details page is shown again

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

Bug6314731_1702651670589.Bzxg0545_1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ae972c8a1958f68f
  • Upwork Job ID: 1736432777544433664
  • Last Price Increase: 2023-12-17
  • Automatic offers:
    • tienifr | Contributor | 28066305

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 17, 2023
  2. changed the title [-]Request Money - If user reloads the IOU details page and go back, the same IOU page is shown[/-] [+][$500] Request Money - If user reloads the IOU details page and go back, the same IOU page is shown[/+] on Dec 17, 2023
  3. melvin-bot commented on Dec 17, 2023

    @melvin-bot
  4. melvin-bot commented on Dec 17, 2023

    @melvin-bot

    Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 17, 2023
  6. melvin-bot commented on Dec 17, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Dec 17, 2023

    @melvin-bot

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

  8. FitseTLT commented on Dec 17, 2023

    @FitseTLT
    Contributor

    Proposal

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

    If user reloads the IOU details page and go back, the same IOU page is shown

    What is the root cause of that problem?

    We push the route when we open deeplink here

    App/src/libs/actions/Report.ts

    Lines 2031 to 2032 in 8bef4bb

    Navigation.navigate(route as Route, CONST.NAVIGATION.ACTION_TYPE.PUSH);
    });

    But we don't push if the route is the active route which is determined in getActiveRoute
    return getActiveRoute().substring(1) === routePath;
    }

    But in this case route we navigate to has a trailing /

    App/src/libs/actions/Report.ts

    Lines 2018 to 2019 in 990815f

    const route = ReportUtils.getRouteFromLink(url);
    if (route === ROUTES.CONCIERGE) {

    but what we get from getActiveRoute() has no slash so getActiveRoute is returning false incorrectly thus we are pushing the route here
    if (!isActiveRoute && type === CONST.NAVIGATION.ACTION_TYPE.PUSH) {
    minimalAction.type = CONST.NAVIGATION.ACTION_TYPE.PUSH;

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

    We should compare them after changing them to same form in here (remove the trailing slashes) to avoid future bugs

    return getActiveRoute().substring(1) === routePath;
    }

        return getActiveRoute().substring(1) === routePath.replace(/\/$/, '');
    
    

    What alternative solutions did you explore? (Optional)

    We can also use more robust url comparing logic; may be use compare-urls to prevent future bugs. (We can use it also in other places where we compare urls 👍 )

  9. Charan-hs commented on Dec 18, 2023

    @Charan-hs
    Contributor

    @FitseTLT I think You can use this Regex

    routePath.replace(/\/$/, '')
  10. FitseTLT commented on Dec 18, 2023

    @FitseTLT
    Contributor

    @Charan-hs Thx Replaced. 👍

  11. tienifr commented on Dec 18, 2023

    @tienifr
    Contributor

    Proposal

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

    The IOU details page is shown again

    What is the root cause of that problem?

    The URL structure that we have here have a redundant / at the end, which is inconsistent with other routes in the App.

    This leads to the isActiveRoute logic here behaves incorrectly because 1 route has / and the end and the other doesn't.

    So when the the current route is not the active route, it will push the current route into itself based on this logic, causing the issue.

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

    1. We should make the URL structure consistent across the App by removing the ending / here. This also fixes a flicker where if you reload on the confirmation page, the ending / will disappear after the site is fully loaded.

    2. That should be enough to fix the issue, but we can enhance the comparison logic here by normalize the routePath before comparing, we can do this by replacing all duplicate / like // or /// with / and removing the ending / sequence. Because sometimes duplicate / or ending / will still make the site behave correctly but the routePath will still contain those irregular slashes, causing this issue.

    What alternative solutions did you explore? (Optional)

    In 1, there're a few other routes that have the same problem, we need to fix it similarly.

  12. 29 remaining items

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 10, 2024
  14. changed the title [-][$500] Request Money - If user reloads the IOU details page and go back, the same IOU page is shown[/-] [+][HOLD for payment 2024-01-17] [$500] Request Money - If user reloads the IOU details page and go back, the same IOU page is shown[/+] on Jan 10, 2024
  15. melvin-bot commented on Jan 10, 2024

    @melvin-bot

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

  16. melvin-bot commented on Jan 10, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.23-4 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-01-17. 🎊

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

  17. melvin-bot commented on Jan 10, 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:

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

    @rushatgabhane
    Member
    1. The PR that introduced the bug has been identified. Link to the PR: Refactor the money request creation flow #28618

    2. 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/pull/28618/files#r1454533414

    3. 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: N.A. We've handled trailing slashes. So this bug shouldn't happen in future.

    4. Determine if we should create a regression test for this bug. No

    5. 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 - N.A.

  19. rushatgabhane commented on Jan 17, 2024

    @rushatgabhane
    Member

    @laurenreidexpensify could you please add payment summary for this issue. Thank you 🙇

  20. laurenreidexpensify commented on Jan 17, 2024

    @laurenreidexpensify
    Contributor

    Payment Summary

    Contributor - @tienifr paid in Upwork $500
    C+ Review - @rushatgabhane pls request in newdot $500

  21. JmillsExpensify commented on Jan 30, 2024

    @JmillsExpensify
    Contributor

    $500 approved fror @rushatgabhane based on comment above.

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