Skip to content

[HOLD for payment 2024-01-17] [$500] The request money preview does not change to "delete" after the request money has been deleted. #30219

Closed

Description

@m-natarajan

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.3.89-6
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: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1698086923136169

Action Performed:

  1. Open a chat
  2. Go to the request money(Pay or delete them if you've requested before)
  3. Enter a specific amount and send the request money
  4. Navigate to the request money detail page
  5. Click on the amount and change it
  6. Click on the three-dot menu and add a receipt file
  7. After adding the receipt, delete the requested money
  8. Go back to the chat

Expected Result:

The request money preview should change to "delete" after the request money has been deleted

Actual Result:

The request money preview does not change to "delete" after the request money has been deleted
Platforms: Tested on web

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

Android: Native
20231023235341.mp4
Android: mWeb Chrome
20231024001325.mp4
iOS: Native
Screen.Recording.2023-10-24.at.12.09.57.AM.mov
iOS: mWeb Safari
Screen.Recording.2023-10-24.at.12.08.43.AM.mov
MacOS: Chrome / Safari
2023-10-23.23-50-02.mp4
Recording.151.mp4
MacOS: Desktop
Screen.Recording.2023-10-24.at.12.22.44.AM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01105d20ae33f4b56d
  • Upwork Job ID: 1716586918273536000
  • Last Price Increase: 2023-11-13

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 23, 2023
  2. melvin-bot commented on Oct 23, 2023

    @melvin-bot

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

  3. changed the title [-]The request money preview does not change to "delete" after the request money has been deleted.[/-] [+][$500] The request money preview does not change to "delete" after the request money has been deleted.[/+] on Oct 23, 2023
  4. melvin-bot commented on Oct 23, 2023

    @melvin-bot
  5. melvin-bot commented on Oct 23, 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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 23, 2023
  7. melvin-bot commented on Oct 23, 2023

    @melvin-bot

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

  8. Nodebrute commented on Oct 24, 2023

    @Nodebrute
    Contributor

    Proposal

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

    The Request Money preview does not update to Delete even after the money request has been deleted after editing the amount.

    What is the root cause of that problem?

    The issue doesn't arise when we initially add a receipt. This bug can be easily reproducible when we edit a money request by modifying the amount or merchant fields and then deleting the chat.

    We encounter two scenarios here:
    In the first scenario, when text is present in the money request, the request is converted to a thread after deletion.
    In the second scenario, when there is no text in the money request, it is completely removed

    When we only have edit request messages in the money request chat, the conversation is transformed into a thread upon deletion and not entirely removed. In such cases, the money request should be entirely removed.

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

    When the chat contains only edited request messages, the money request should be completely removed, rather than being converted into a thread.

    What alternative solutions did you explore? (Optional)

  9. tienifr commented on Oct 24, 2023

    @tienifr
    Contributor

    Proposal

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

    1. The request money preview does not change to "delete" after the request money has been deleted
    2. The amount in the money request report and main chat report is shown as TBD, which should not be the case since TBD is only for distance request transactions.

    What is the root cause of that problem?

    1. When users edit the amount/description... we add the new modified message to IOU report, but did not increase childVisibleActionCount. That makes isDeletedParentAction is false -> [Deleted Request] is not shown
    2. This logic to calculate whether a report only has distance request is incorrect. If the transaction list is empty, _.all here will always return true, so a report without any transactions is considered as a report with only distance request transactions.

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

    1. When edit amount/description,... we should increase the childVisibleActionCount of parentReportAction
        const parentReportAction = ReportActionsUtils.getReportAction(transactionThread.parentReportID,transactionThread.parentReportActionID)
    ...
    {
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThread.parentReportID}`,
                value: {
                    [transactionThread.parentReportActionID]: {
                        childVisibleActionCount:(parentReportAction.childVisibleActionCount || 0) +1,
                    },
                },
            },
    
    1. Check the length of allTransactions as well here
     return allTransactions.length > 0 && _.all(allTransactions, (transaction) => TransactionUtils.isDistanceRequest(transaction));
    

    What alternative solutions did you explore? (Optional)

    Result

    Screen.Recording.2023-11-09.at.18.39.07.mov
  10. isabelastisser commented on Oct 25, 2023

    @isabelastisser
    Contributor

    Hey @allroundexperts, can you please review the proposals above? Thanks!

  11. rojiphil commented on Oct 27, 2023

    @rojiphil
    Contributor

    Proposal

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

    When the last money request is deleted from the IOU report, the corresponding report preview in chat report should change to [Deleted request] . While this is not required for the case where the IOU Report has no visible child actions (also the BE deletes the IOUReport and corresponding Report Preview in chat report), [Deleted request] needs to be displayed in scenarios where IOU Report has visible child actions. This is the problem we are trying to solve here.

    What is the root cause of that problem?

    These are improvements over an existing implementation of money requests.

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

    To solve this problem, instead of displaying the usual Report Preview content, we can display [Deleted request] when there are visible actions but there are no money requests left in the IOU Report. We can make the changes like this here

        const childVisibleActionCount = _.get(props, ['action', 'childVisibleActionCount'], 0);        
        const childMoneyRequestCount = _.get(props, ['action', 'childMoneyRequestCount'], 0);        
        if ((childVisibleActionCount > 0 && childMoneyRequestCount === 0) ) {
            return <RenderHTML html={`<comment>${props.translate('parentReportAction.deletedRequest')}</comment>`} />;
        }    
    

    Additionally, LHN messages also need to be updated accordingly so that [Deleted request] is displayed.

    Test Video

    Here is how the test video looks once this fix + fix of proposal here is implemented.
    Also, refer discussion here

    26511-30219-fix.mp4

    What alternative solutions did you explore? (Optional)

  12. 99 remaining items

  13. melvin-bot commented on Jan 10, 2024

    @melvin-bot

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

  14. 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:

    • @rojiphil requires payment (Needs manual offer from BZ)
    • @allroundexperts requires payment through NewDot Manual Requests
    • @tienifr requires payment (Needs manual offer from BZ)
    • @ayazhussain79 requires payment (Needs manual offer from BZ)
  15. 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:

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

    @rojiphil
    Contributor

    If no regressions arise, payment will be issued on 2024-01-17

    @isabelastisser @rlinoz @allroundexperts
    Would it be fair to increase the compensation to $750 for @rojiphil (C Contributor) and @allroundexperts (C+ contributor) as this PR also fixes an additional issue (with a different root cause) here.
    In all, we have fixed three different issues here.
    What do you think?

  17. melvin-bot commented on Jan 17, 2024

    @melvin-bot

    Payment Summary

    [Upwork Job]https://www.upwork.com/jobs/~01039c8780fdfa2166

    BugZero Checklist (@isabelastisser)

    • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1716586918273536000/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  18. isabelastisser commented on Jan 18, 2024

    @isabelastisser
    Contributor

    We are discussing the payment amount here.

  19. isabelastisser commented on Jan 19, 2024

    @isabelastisser
    Contributor

    Offers sent in Upwork.

    Reviewer: @allroundexperts owed $750 via NewDot PENDING

  20. isabelastisser commented on Jan 19, 2024

    @isabelastisser
    Contributor

    @allroundexperts please complete the checklist above. Thanks!

  21. allroundexperts commented on Jan 21, 2024

    @allroundexperts
    Contributor

    Checklist

    1. Add DeleteMoneyRequest #19095
    2. https://github.com/Expensify/App/pull/19095/files#r1461207158
    3. N/A
    4. A regression test would be useful here IMO. The steps given in the OP look good enough to me.
  22. isabelastisser commented on Jan 22, 2024

    @isabelastisser
    Contributor
  23. JmillsExpensify commented on Jan 30, 2024

    @JmillsExpensify
    Contributor

    $750 approved for @allroundexperts based on this comment.

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.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions