Skip to content

[Due for payment 2025-05-14] [Due for payment 2025-05-08] Reports -"Complete" button on deleted task becomes responsive when turning to Most Recent mode #61025

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

Closed
3 of 8 tasks
mitarachim opened this issue Apr 29, 2025 · 17 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented Apr 29, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.1.33-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome
App Component: Other

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Open any chat.
  3. Create a task.
  4. Open the just created task and tap on the header.
  5. Delete the task.
  6. Navigate to "Reports"
  7. Tap on the bookmark icon.
  8. Tap on "Tasks"
  9. Note that the deleted task is still displayed and the "Complete" button is grayed out and unresponsive.
  10. Navigate to "Account" and select "Preferences"
  11. Change priority mode to "Focus"
  12. Change priority mode to "Most Recent" again.
  13. Return to "Reports" > "Tasks"
  14. Note that "Complete" button is now responsive again.
  15. Tap on it and open the task.
  16. Note that an error message is displayed.
  17. Dismiss error message and return to LHN.
  18. Note that a new chat is displayed for the deleted task and that the chat has a RBR that can´t be dismissed.

Expected Result:

Deleted task shouldn´t display the option to be marked as complete.

Actual Result:

"Complete" button on deleted task on "Reports" becomes responsive again after switching to "Focus" mode and returning to "Most Recent". Tapping on it, triggers a "You don´t have permission to take the requested action" error message and after this action, a new chat for the task, appears on LHN, with a RBR that can´t be dismissed.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6815835_1745888722617.Recent.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @laurenreidexpensify
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Triggered auto assignment to @laurenreidexpensify (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.

Copy link

melvin-bot bot commented Apr 29, 2025

Triggered auto assignment to @Beamanator (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Apr 29, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 29, 2025
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@samranahm
Copy link
Contributor

Proposal

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

Complete" button on deleted task becomes responsive when turning to Most Recent mode

What is the root cause of that problem?

Here

text={translate('task.action')}
style={[styles.w100]}
isDisabled={!canActionTask(taskItem.report, session?.accountID ?? CONST.DEFAULT_NUMBER_ID, taskCreatorID, taskAssigneeID)}

we check if the complete button should be disable

inside canActionTask we check if it's isCanceledTaskReport

App/src/libs/actions/Task.ts

Lines 1238 to 1240 in bd0f3f2

if (ReportUtils.isCanceledTaskReport(taskReport)) {
return false;
}

Then inside isCanceledTaskReport the only method we use is by checking isDeletedParentAction that indeed return true initially but as soon we change our preference mood the data get reset and isDeletedParentAction become undefined leading to make to Complete button responsive even the report was closed/ deleted

App/src/libs/ReportUtils.ts

Lines 1314 to 1318 in bd0f3f2

if (!isEmptyObject(parentReportAction) && (getReportActionMessageReportUtils(parentReportAction)?.isDeletedParentAction ?? false)) {
return true;
}
if (!isEmptyObject(report) && report?.isDeletedParentAction) {

When we delete the task report

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

We should explicitly check is the report is closed here then return true

if (!isEmptyObject(report) && (report?.isDeletedParentAction || isClosedReport(report))) {
    return true;
    }

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@Beamanator
Copy link
Contributor

@samranahm thanks so much for the proposal! But since this is a deploy blocker, we're pretty confident this bug came from a recent PR, so we would like to prioritize finding which PR caused this bug so the PR author can fix this... Can you help us find the PR that may have caused this bug? 🙏

@linhvovan29546
Copy link
Contributor

@Beamanator Is this a new feature? #59672

@samranahm
Copy link
Contributor

@Beamanator Seems like this blocker is related to #59672 and this commit but this commit only pass taskCreatorID, taskAssigneeID to canActionTask that does not cause this issue at all

so we should keep it separated

@luacmartins
Copy link
Contributor

@JS00001

@Beamanator
Copy link
Contributor

Great catches, y'all! Will discuss with @JS00001 👍

@Beamanator Beamanator removed the DeployBlocker Indicates it should block deploying the API label Apr 29, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Apr 29, 2025
@JS00001 JS00001 removed the DeployBlockerCash This issue or pull request should block deployment label Apr 29, 2025
@JS00001
Copy link
Contributor

JS00001 commented Apr 29, 2025

This PR was reverted and is now off of staging

@JS00001 JS00001 closed this as completed Apr 29, 2025
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Apr 30, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 30, 2025
@melvin-bot melvin-bot bot changed the title Reports -"Complete" button on deleted task becomes responsive when turning to Most Recent mode [Due for payment 2025-05-08] Reports -"Complete" button on deleted task becomes responsive when turning to Most Recent mode May 1, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 1, 2025
Copy link

melvin-bot bot commented May 1, 2025

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

Copy link

melvin-bot bot commented May 1, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.38-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 2025-05-08. 🎊

Copy link

melvin-bot bot commented May 1, 2025

@Beamanator / @JS00001 @laurenreidexpensify @Beamanator / @JS00001 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels May 7, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-05-08] Reports -"Complete" button on deleted task becomes responsive when turning to Most Recent mode [Due for payment 2025-05-14] [Due for payment 2025-05-08] Reports -"Complete" button on deleted task becomes responsive when turning to Most Recent mode May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 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 2025-05-14. 🎊

Copy link

melvin-bot bot commented May 7, 2025

@Beamanator / @JS00001 @laurenreidexpensify @Beamanator / @JS00001 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@JS00001
Copy link
Contributor

JS00001 commented May 7, 2025

Doesnt need payment, this was fixed internally

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. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants