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

[$500] [DISTANCE] LOW: Distance IOU - Addresses are cleared after navigating between address and confirmation page #28913

Closed
6 tasks done
lanitochka17 opened this issue Oct 5, 2023 · 25 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Distance Wave5-free-submitters External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 5, 2023

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


Issue found when executing PR #26307

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Go to + > Request money > Distance
  3. Enter start and finish address, then proceed all the way to the confirmation screen
  4. Return back to the Distance address page
  5. Proceed to the final confirmation page
  6. Back to Distance address page

Expected Result:

The addresses that are entered are preserved

Actual Result:

The addresses that are entered are cleared

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.78-0

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6225738_1696503258441.20231005_181639.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e02f1e0185235867
  • Upwork Job ID: 1735782081162653696
  • Last Price Increase: 2023-12-15
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

@kosmydel
Copy link
Contributor

kosmydel commented Oct 5, 2023

Hey, I checked it since it was found when checking my PR. Just want to say, that this issue also occurs in production, so it's probably not related to my PR.

Video

Screen.Recording.2023-10-05.at.16.52.32.mov

@AmjedNazzal
Copy link
Contributor

Proposal

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

Distance IOU - Addresses are cleared after navigating between address and confirmation page

What is the root cause of that problem?

In multiple places through the money request components we are using the following logic:

const shouldReset = props.iou.id !== moneyRequestId;
if (shouldReset) {
    IOU.resetMoneyRequestInfo(moneyRequestId);
}

This logic becomes problematic when IOU.navigateToNextPage is being called by the navigateToNextPage function and in MoneyRequestParticipantsPage as it repetedly checks shouldReset within it's useEffect but the issue here is that these two don't always have access to the updated reportID and so when the user chooses where the distance request will be shared, iou.id becomes "request" + the reportID but for the components I mentioned since they don't have access to that reportID the value of moneyRequestId will remain just "request" and so they will call IOU.resetMoneyRequestInfo

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

We can either make some changes to make sure that these components are having the most recent reportID or we can add a safeguard check to make sure that a reportID does indeed exist before checking if it equals iou.id

In MoneyRequestParticipantsPage:

if(reportID.current){
    const moneyRequestId = `${iouType.current}${reportID.current}`;
    const shouldReset = iou.id !== moneyRequestId && !isNewReportIDSelectedLocally.current;
    if (shouldReset) {
    IOU.resetMoneyRequestInfo(moneyRequestId);
    }
}

In IOU.navigateToNextPage:

if(report.reportID){
    if (shouldReset) {
        resetMoneyRequestInfo(moneyRequestID);
    }
}

There are a bunch of other possible options we can do here but the general idea is to not allow calling resetMoneyRequestInfo unless we do some control regarding reportID

Result

Screen.Recording.2023-10-05.at.7.10.00.PM.mov

@neil-marcellini
Copy link
Contributor

I think this will be fixed by #26538 (comment), so I'm holding it on that.

@neil-marcellini neil-marcellini changed the title Distance IOU - Addresses are cleared after navigating between address and confirmation page [HOLD 26538] Distance IOU - Addresses are cleared after navigating between address and confirmation page Oct 5, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

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

@johncschuster
Copy link
Contributor

Still holding. Not overdue.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 10, 2023
@johncschuster
Copy link
Contributor

Still holding

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
@johncschuster
Copy link
Contributor

Shall we bump to Weekly while we wait, @neil-marcellini?

@melvin-bot melvin-bot bot added the Overdue label Oct 16, 2023
@johncschuster johncschuster added Weekly KSv2 and removed Daily KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@johncschuster
Copy link
Contributor

Bumping to Weekly

@melvin-bot melvin-bot bot added the Overdue label Oct 25, 2023
@johncschuster
Copy link
Contributor

Still holding

@melvin-bot melvin-bot bot removed the Overdue label Oct 25, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 3, 2023
@dylanexpensify dylanexpensify changed the title [HOLD 26538] Distance IOU - Addresses are cleared after navigating between address and confirmation page [DISTANCE] [HOLD 26538] LOW: Distance IOU - Addresses are cleared after navigating between address and confirmation page Nov 7, 2023
@dylanexpensify dylanexpensify added the Distance Wave5-free-submitters label Nov 7, 2023
@johncschuster
Copy link
Contributor

No update. We're still holding on #26538 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Nov 7, 2023
@johncschuster
Copy link
Contributor

Still holding

@melvin-bot melvin-bot bot removed the Overdue label Dec 1, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
@johncschuster
Copy link
Contributor

Looks like we're still on hold

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2023
@dylanexpensify dylanexpensify changed the title [DISTANCE] [HOLD 26538] LOW: Distance IOU - Addresses are cleared after navigating between address and confirmation page [DISTANCE] LOW: Distance IOU - Addresses are cleared after navigating between address and confirmation page Dec 14, 2023
@dylanexpensify
Copy link
Contributor

off hold @johncschuster! 🎉

@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Dec 15, 2023
@johncschuster johncschuster removed their assignment Dec 15, 2023
@melvin-bot melvin-bot bot changed the title [DISTANCE] LOW: Distance IOU - Addresses are cleared after navigating between address and confirmation page [$500] [DISTANCE] LOW: Distance IOU - Addresses are cleared after navigating between address and confirmation page Dec 15, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

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

@johncschuster johncschuster removed the Bug Something is broken. Auto assigns a BugZero manager. label Dec 15, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 15, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 15, 2023
@johncschuster johncschuster added the Bug Something is broken. Auto assigns a BugZero manager. label Dec 15, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

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

@johncschuster
Copy link
Contributor

I will be OOO starting Monday, December 18, and will return Tuesday, January 2.

Current status:
This issue was just taken off hold and assigned to a C+ member to start reviewing proposals.

If this issue is open when I'm back from OOO, I'll take it back over. Thank you!

Copy link

melvin-bot bot commented Dec 15, 2023

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

@johncschuster johncschuster self-assigned this Dec 15, 2023
@paultsimura
Copy link
Contributor

Not reproducible after the IOU flow refactoring

@AmjedNazzal
Copy link
Contributor

This has been resolved using underscore from DefinitelyTyped

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@jjcoffee
Copy link
Contributor

@muttmuure We can close this!

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
@johncschuster
Copy link
Contributor

I happened to be traipsing through to finish up my OOO checklist. I'll go ahead and close it. Thanks, @jjcoffee!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Distance Wave5-free-submitters External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
No open projects
Development

No branches or pull requests

9 participants