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

[HOLD for payment 2024-03-05][$500] "Delete Request" and "Add Recipient" options persist after deletion until page refresh #36496

Closed
3 of 6 tasks
lanitochka17 opened this issue Feb 14, 2024 · 13 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 14, 2024

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.41-2
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): abebemihiret@gmail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to FAB > Request money
  2. Add amount, select email or workspace, confirm request
  3. Navigate to IOU
  4. Add attachment or write comment on IOU, then click the three dots to delete the request
  5. Click on the three dots again; "Delete Request" and "Add Recipient" options persist until navigating to another page or refreshing

Expected Result:

"Delete Request" and "Add Recipient" options should be immediately removed after deleting the request

Actual Result:

The options persist until the page is refreshed or navigated away from and then back to

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

Bug6379322_1707914136239.Screen_Recording_2024-02-14_at_3.46.47_AM.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016b309ef80952eec2
  • Upwork Job ID: 1757777779410464768
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • jjcoffee | Reviewer | 0
    • paultsimura | Contributor | 0
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 14, 2024
@melvin-bot melvin-bot bot changed the title "Delete Request" and "Add Recipient" options persist after deletion until page refresh [$500] "Delete Request" and "Add Recipient" options persist after deletion until page refresh Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

Copy link

melvin-bot bot commented Feb 14, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp
CC @quinthar

@paultsimura
Copy link
Contributor

Proposal

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

The "delete" and "add receipt" options do not disappear from the 3-dot menu.

What is the root cause of that problem?

This is happening because we are memoizing the ReportScreen without taking into account the parentReportAction.

When we remove the money request, the parentReportAction becomes isDeleted: true here:

const canModifyRequest = isActionOwner && !isSettled && !isApproved && !ReportActionsUtils.isDeletedAction(parentReportAction);

So after the parentReportAction is deleted, we shouldn't be able to modify the money request, and therefore the buttons won't be present in the 3-dot menu. However, since the ReportScreen is memoized incorrectly, the parentReportAction doesn't get updated in the MoneyRequestHeader, and the buttons are still present.

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

We need to add a check to compare the props.parentReportAction here:

_.isEqual(prevProps.parentReportAction, nextProps.parentReportAction)

memo(
ReportScreen,
(prevProps, nextProps) =>
prevProps.isSidebarLoaded === nextProps.isSidebarLoaded &&
_.isEqual(prevProps.reportActions, nextProps.reportActions) &&
_.isEqual(prevProps.reportMetadata, nextProps.reportMetadata) &&
prevProps.isComposerFullSize === nextProps.isComposerFullSize &&
_.isEqual(prevProps.betas, nextProps.betas) &&
_.isEqual(prevProps.policies, nextProps.policies) &&
prevProps.accountManagerReportID === nextProps.accountManagerReportID &&
prevProps.userLeavingStatus === nextProps.userLeavingStatus &&
prevProps.currentReportID === nextProps.currentReportID &&
prevProps.viewportOffsetTop === nextProps.viewportOffsetTop &&
_.isEqual(prevProps.report, nextProps.report),
),

Result:

Screen.Recording.2024-02-14.at.16.01.36-compressed.mp4

What alternative solutions did you explore? (Optional)

@jjcoffee
Copy link
Contributor

@paultsimura's proposal LGTM!

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 14, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

📣 @jjcoffee 🎉 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

Copy link

melvin-bot bot commented Feb 14, 2024

📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 14, 2024
@paultsimura
Copy link
Contributor

Thanks. The PR is ready for review: #36546

@paultsimura
Copy link
Contributor

Deployed to production: #36546 (comment)

@cristipaval cristipaval added the Awaiting Payment Auto-added when associated PR is deployed to production label Feb 27, 2024
@cristipaval cristipaval changed the title [$500] "Delete Request" and "Add Recipient" options persist after deletion until page refresh [HOLD for payment 2024-03-05][$500] "Delete Request" and "Add Recipient" options persist after deletion until page refresh Feb 27, 2024
@cristipaval cristipaval removed the Reviewing Has a PR in review label Feb 27, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 4, 2024
@jjcoffee
Copy link
Contributor

jjcoffee commented Mar 5, 2024

  • The PR that introduced the bug has been identified. Link to the PR: Hide three dot in header when request is deleted #28214
  • 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: Hide three dot in header when request is deleted #28214 (comment)
  • 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
  • Determine if we should create a regression test for this bug. Yes
  • 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. Request money
  2. Navigate to the created Money Request
  3. Write a comment
  4. Click the 3-dots menu -> delete the request
  5. Click on the 3-dots menu again
  6. Verify the "Delete Request" and "Add Recipient" options are no longer shown

Do we agree 👍 or 👎

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Mar 6, 2024

Thanks for tagging me in this @paultsimura!

Payouts due:

Contributor: $500 @paultsimura (paid in Upwork)
Contributor+: $500 @jjcoffee (paid in Upwork)

Upwork job is here.

Regression test posted - https://github.com/Expensify/Expensify/issues/376258

Closing this! let me know if I'm missing anything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

5 participants