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-07-26] [$250] Android - Task - Deleted task is shown briefly and then disappears from conversation page #44997

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 8, 2024 · 25 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 Jul 8, 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: 9.0.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: https://expensify.testrail.io/index.php?/tests/view/4704499
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch app
  2. Open a report
  3. Tap plus icon -- assign task
  4. Enter a title and tap next
  5. Tap confirm task
  6. Open the task created
  7. Tap header - delete option

Expected Result:

Deleted task must not be shown briefly in conversation page

Actual Result:

Deleted task is shown briefly and then disappears from conversation page

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

Bug6536169_1720462778895.screenrecorder-2024-07-08-20-58-12-710_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d0d653c8ad7776ae
  • Upwork Job ID: 1810491099806319286
  • Last Price Increase: 2024-07-09
  • Automatic offers:
    • alitoshmatov | Reviewer | 103061198
    • dominictb | Contributor | 103061200
Issue OwnerCurrent Issue Owner: @alitoshmatov
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 8, 2024
Copy link

melvin-bot bot commented Jul 8, 2024

Triggered auto assignment to @VictoriaExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@VictoriaExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

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

@cretadn22
Copy link
Contributor

Proposal

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

What is the root cause of that problem?

When a task is deleted, we mark the parentReportAction's pendingAction as "UPDATE"

pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,

Here, if pendingAction is not "DELETE," we continue to show the deleted task until we receive the data from the backend

() =>
sortedReportActions.filter(
(reportAction) =>
(isOffline ||
ReportActionsUtils.isDeletedParentAction(reportAction) ||
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ||
reportAction.errors) &&
ReportActionsUtils.shouldReportActionBeVisible(reportAction, reportAction.reportActionID),
),

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

pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,

Setting pendingAction to "DELETE" to indicate that a deletion action is pending

What alternative solutions did you explore? (Optional)

@VictoriaExpensify
Copy link
Contributor

Issue recreated. Agree this is a bug that belongs in VSP.

@VictoriaExpensify VictoriaExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

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

@melvin-bot melvin-bot bot changed the title Android - Task - Deleted task is shown briefly and then disappears from conversation page [$250] Android - Task - Deleted task is shown briefly and then disappears from conversation page Jul 9, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

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

@dominictb
Copy link
Contributor

Proposal

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

Deleted task is shown briefly and then disappears from conversation page

What is the root cause of that problem?

  • In here:
    pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,

    we always set the pendingAction to CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE regardless whether the task report should be deleted or not. That leads to when the API is not done, it still display the task action because these two conditions are true:
    reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ||

    and
    return !isDeleted || isPending || isDeletedParentAction(reportAction) || isReversedTransaction(reportAction);

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

        pendingAction: shouldDeleteTaskReport ? CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE : CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,

like we did when deleting track expense:

pendingAction: shouldShowDeletedRequestMessage ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,

or deleting expense:
pendingAction: shouldShowDeletedRequestMessage ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,

What alternative solutions did you explore? (Optional)

@kaushiktd
Copy link
Contributor

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

Deleted task is shown briefly and then disappears from conversation page

What is the root cause of that problem?

The root cause of this issue is that the pendingAction for a deleted task is always set to CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, regardless of whether the task should be deleted. This results in the task being displayed until the backend confirms the deletion. Specifically, in App/src/libs/actions/Task.ts, the pendingAction is set to UPDATE, which leads to the following filtering conditions in App/src/pages/home/report/ReportActionsList.tsx not excluding the deleted task immediately:

() =>
sortedReportActions.filter(
(reportAction) =>
(isOffline ||
ReportActionsUtils.isDeletedParentAction(reportAction) ||
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ||
reportAction.errors) &&
ReportActionsUtils.shouldReportActionBeVisible(reportAction, reportAction.reportActionID),
),

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

const sortedVisibleReportActions = useMemo(
    () =>
        sortedReportActions.filter(
            (reportAction) =>
                (isOffline ||
                    ReportActionsUtils.isDeletedParentAction(reportAction) ||
                    (reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE &&
                     reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE) ||
                    reportAction.errors) &&
                ReportActionsUtils.shouldReportActionBeVisible(reportAction, reportAction.reportActionID),
        ),
    [sortedReportActions, isOffline],
);

reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE: Ensures that tasks with pending DELETE or UPDATE actions are excluded from the visible actions.

video:-

screen-capture.1.online-video-cutter.com.mp4

@alitoshmatov
Copy link
Contributor

@cretadn22 Thank you for your proposal, your RCA is correct. However you missed a case where task report is still shown where it has some report actions in it. Your solution makes it disappear in optimistic data and appear again when backend data is received.

@alitoshmatov
Copy link
Contributor

@dominictb Thank you for your proposal, your RCA is correct and your are providing a correct solution

@alitoshmatov
Copy link
Contributor

@kaushiktd Thank you for your proposal, your RCA seems to focus on wrong area and provided a wrong solution

@alitoshmatov
Copy link
Contributor

We can go with @dominictb 's proposal

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Jul 9, 2024

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

@kaushiktd
Copy link
Contributor

@alitoshmatov can you please explain where it go wrong

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

melvin-bot bot commented Jul 10, 2024

📣 @alitoshmatov 🎉 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 Jul 10, 2024

📣 @dominictb 🎉 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 Weekly KSv2 and removed Daily KSv2 labels Jul 11, 2024
@dominictb
Copy link
Contributor

PR #45279 is ready.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 19, 2024
@melvin-bot melvin-bot bot changed the title [$250] Android - Task - Deleted task is shown briefly and then disappears from conversation page [HOLD for payment 2024-07-26] [$250] Android - Task - Deleted task is shown briefly and then disappears from conversation page Jul 19, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

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

Copy link

melvin-bot bot commented Jul 19, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.9-5 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-07-26. 🎊

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

Copy link

melvin-bot bot commented Jul 19, 2024

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:

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

@alitoshmatov
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Update Canceled task flow #24137
  • 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/24137/files#r1692881438
  • 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: No need
  • Determine if we should create a regression test for this bug. I think there is no need for test

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 26, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

@madmax330, @VictoriaExpensify, @alitoshmatov, @dominictb Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
@VictoriaExpensify
Copy link
Contributor

  • Link the GH issue for creating/updating the regression test once above steps have been agreed upon: - N/A

@VictoriaExpensify
Copy link
Contributor

Contributor: @dominictb paid $250 via Upwork
Contributor+: @alitoshmatov paid $250 via Upwork

Upwork job here!

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
No open projects
Archived in project
Development

No branches or pull requests

7 participants