Skip to content

[$1000] Web - Delete Button Fails to Delete Changed Description in IOU #25997

Closed

Description

@kbecciv

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


Action Performed:

  1. Click on the plus sign and select "Request Money"
  2. Enter desired amount and email address for Request Money
  3. Open the IOU and change the description
  4. Click on the three dots and select "Delete Request"
  5. Observe that the Request is deleted, but the changed description remains in the IOU

Expected Result:

The Delete button should delete the changed description from the IOU as well.

Actual Result:

The Delete button fails to delete the changed description inside the IOU.

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.57-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

screen-capture.-.2023-08-17T112708.989.webm
Recording.4040.mp4

Expensify/Expensify Issue URL:
Issue reported by: @tewodrosGirmaA
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692252491955339

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01462271c6de352d0a
  • Upwork Job ID: 1696152844806086656
  • Last Price Increase: 2023-09-18

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 26, 2023
  2. melvin-bot commented on Aug 26, 2023

    @melvin-bot

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

  3. melvin-bot commented on Aug 26, 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
  4. CortneyOfstad commented on Aug 28, 2023

    @CortneyOfstad
    Contributor

    Was able to recreate, as shown in the screenshots below. Getting eyes on this!

    Screenshot 2023-08-28 at 8 27 42 AM Screenshot 2023-08-28 at 8 27 52 AM
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 28, 2023
  6. changed the title [-]Web - Delete Button Fails to Delete Changed Description in IOU[/-] [+][$1000] Web - Delete Button Fails to Delete Changed Description in IOU[/+] on Aug 28, 2023
  7. melvin-bot commented on Aug 28, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 28, 2023
  9. melvin-bot commented on Aug 28, 2023

    @melvin-bot

    Current assignee @CortneyOfstad is eligible for the External assigner, not assigning anyone new.

  10. melvin-bot commented on Aug 28, 2023

    @melvin-bot

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

  11. WaqasIbrahim commented on Aug 28, 2023

    @WaqasIbrahim

    This seems like an internal issue. I sent two requests.
    Without description change:
    Screenshot 2023-08-28 at 7 27 20 PM

    With description change:
    Screenshot 2023-08-28 at 7 27 38 PM

    Look at the value of hasOutstandingIOU in both cases.

  12. dukenv0307 commented on Aug 28, 2023

    @dukenv0307
    Contributor

    Proposal

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

    The Delete button fails to delete the changed description inside the IOU.

    What is the root cause of that problem?

    In these lines, we have the logic to check whether we should delete the transaction threads, we'll delete it if there's no visible message. However, we're not excluding the MODIFIEDEXPENSE action when calculating that visible message. So if there's any MODIFIEDEXPENSE action, the transaction thread will not be deleted and the actions will still be visible.

    It doesn't make sense to keep all the MODIFIEDEXPENSE actions once the transaction thread is deleted by the user, so we should also delete the transaction thread if it contains only MODIFIEDEXPENSE actions.

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

    We need to exclude the MODIFIEDEXPENSE report actions when calculating the last message here

    const shouldDeleteTransactionThread = transactionThreadID ? ReportActionsUtils.getLastVisibleMessage(transactionThreadID).lastMessageText.length === 0 : false;
    .

    This can be done by, for example, adding a shouldExclude callback to the getLastVisibleAction and getLastVisibleMessage. The default value of shouldExclude in those definitions will be shouldExclude = () => false

    And then we can update this line to

    const visibleActions = _.filter(actions, (action) => shouldReportActionBeVisibleAsLastAction(action) && !shouldExclude(action);
    

    We'll use it to filter out the MODIFIEDEXPENSE actions here like

    const shouldDeleteTransactionThread = transactionThreadID ? ReportActionsUtils.getLastVisibleMessage(transactionThreadID, {}, ReportActionsUtils.isModifiedExpenseAction).lastMessageText.length === 0 : false;
    

    Similarly, we need to update the usage of getLastVisibleAction, getLastVisibleMessage in that file for consistency.

    If it's desirable to delete all MODIFIEDEXPENSE actions even though there're other non-MODIFIEDEXPENSE actions in the list, we can remove them in the optimisticData here as well.

    The back-end will need to be fixed similarly

    What alternative solutions did you explore? (Optional)

    There're other ways to do the above besides shouldExclude, like adding shouldExcludeModifiedExpense boolean, or create a new set of functions getLastVisibleAction, getLastVisibleMessage similar to to use in that delete money request case.

    Details on the shouldExcludeModifiedExpense solution:

    1. Adding a shouldExcludeModifiedExpense boolean param to the getLastVisibleAction and getLastVisibleMessage. The default value of shouldExcludeModifiedExpense in those definitions will be false

    2. Update this line to

    const visibleActions = _.filter(actions, (action) => shouldReportActionBeVisibleAsLastAction(action) && !(shouldExcludeModifiedExpense && isModifiedExpenseAction(action)));
    

    so it won't include the modified expense action if the shouldExcludeModifiedExpense is true.

    1. We'll use it to filter out the MODIFIEDEXPENSE actions here (by passing shouldExcludeModifiedExpense as true)
      Same for the usage of getLastVisibleAction, getLastVisibleMessage in that file for consistency.

    The back-end will also need to be fixed to delete the transaction thread in that case.

  13. 133 remaining items

  14. mallenexpensify commented on Jan 23, 2024

    @mallenexpensify
    Contributor

    For #27570 (comment)

    A proposal was #27570 (comment) and while implementing the #29259, it was decided that the issue would be best solved on the backend.

    and our internal doc states

    We also pay 100% to the contributor and C+ if we hired them then decided to fix the issue internally or close the issue (assuming the contributor and C+ were both actively working on the issue).

    This issue is different because we didn't make a decision to fix it on the backend.

    For #30692 (comment)
    Both Jasper and Vivek agreed to close the issue, so that's also different than issue and also fits with the stated guideline above.

    Part of what leads me to believe 50% is fair is because the hire date was Oct 5 and the PR was still being worked on as of Dec 28th and there were multiple bumps to move the PR along. If this PR would have been merged before the one that fixed it, would it have made a difference? (I don't know). If so, then we could have saved time both working on this one AND the other by closing them both sooner.

    We appreciate and value the time and investment, our main goal is to get bugs fixed and to do it with urgency, which is what I consider the a benchmark for similar issues like there where another PR (appears to) magically fix the bug (from what I know, I'm not the most well versed on this specific issue or PR)

  15. dukenv0307 commented on Jan 23, 2024

    @dukenv0307
    Contributor

    the hire date was #25997 (comment) and the PR was still being worked on as of #28995 (comment) and there were multiple bumps to move the PR along.

    @mallenexpensify I believe part of the reason for the delay is this is a fairly complex issue, we faced many technical challenges during the implementation and tried to make sure to resolve all of them (~50 commits) before merging to not cause regressions/affect the app performance.

    So I'd appreciate if we can keep the full payment here since the PR is mostly ready for merging before it was made outdated due to another change. Also the reason why the other PR was able to resolve the bugs is not because that PR resolves the technical issues we faced, just that they achieved a different expectation that conflicts with the expectations in this issue so this issue is no longer reproducible.

    If this PR would have been merged before the one that fixed it, would it have made a difference? (I don't know)

    @mallenexpensify regarding this, it will not make a difference since the 2 PRs have 2 conflicting expectations, if this PR is merged first, the other PR would still override the expectation in this PR.

  16. mallenexpensify commented on Jan 26, 2024

    @mallenexpensify
    Contributor

    Thanks @dukenv0307 , we're discussing internally.

  17. jasperhuangg commented on Jan 26, 2024

    @jasperhuangg
    Contributor

    @dukenv0307 @mollfpr Thank you for your patience with this matter. We've discussed this internally and have decided to keep full payment on your work considering the sheer amount of time and effort you've put into implementation and review. Thank you for sticking with it, we really appreciate your hard work!

  18. jasperhuangg commented on Jan 29, 2024

    @jasperhuangg
    Contributor

    @CortneyOfstad can you help with issuing payment here?

  19. CortneyOfstad commented on Jan 29, 2024

    @CortneyOfstad
    Contributor

    Created a new Job post here — https://www.upwork.com/jobs/~016e3532aa6b8d64fd

    @dukenv0307 sent you a proposal in Upwork

    @mollfpr you'll be paid via NewDot — I'll create the proposal once Duc accepts in Upwork 👍

  20. dukenv0307 commented on Jan 30, 2024

    @dukenv0307
    Contributor

    @dukenv0307 sent you a proposal in Upwork

    @CortneyOfstad I've accepted, thank you!

  21. tewodrosGirmaA commented on Jan 30, 2024

    @tewodrosGirmaA

    @CortneyOfstad @jasperhuangg May I inquire about my eligibility for compensation regarding the bug report? Thank you.

  22. mallenexpensify commented on Jan 30, 2024

    @mallenexpensify
    Contributor

    ah.. yes, @tewodrosGirmaA you are eligible since this was reported forever ago, ha. Amount is $250 because it was before the decrease to $50. .
    @CortneyOfstad can you pay out plz?

  23. CortneyOfstad commented on Jan 31, 2024

    @CortneyOfstad
    Contributor

    Sorry about that @tewodrosGirmaA! I sent you a proposal in Upwork — let me know once you accept and I'll get that paid ASAP. Thanks!

  24. tewodrosGirmaA commented on Jan 31, 2024

    @tewodrosGirmaA

    Hello @CortneyOfstad i accept it , Thank you

  25. CortneyOfstad commented on Jan 31, 2024

    @CortneyOfstad
    Contributor

    Payment Summary

    @tewodrosGirmaA (reporter) — paid $250 via Upwork
    @dukenv0307 (contributor) — paid $1000 via Upwork
    @mollfpr (C+) — to be paid $1000 via NewDot

  26. tewodrosGirmaA commented on Jan 31, 2024

    @tewodrosGirmaA

    Thank you @CortneyOfstad

  27. JmillsExpensify commented on Jan 31, 2024

    @JmillsExpensify
    Contributor

    $1,000 approved for @mollfpr for based on summary above.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions