-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-10-30] [$250] [Dupe detection] Report header has "Hold" action when the expense is already in Hold status #49872
Comments
Triggered auto assignment to @jasperhuangg ( |
Triggered auto assignment to @stephanieelliott ( |
👋 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:
|
On prod, the other expense vanishes instantly bandicam.2024-09-28.00-52-50-976.mp4 |
We think that this bug might be related to #wave-collect - Release 1 |
Dupe detection is behind a beta w/ only internal users and developers, this is NAB |
Edited by proposal-police: This proposal was edited at 2024-09-29 10:06:58 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The report header has "Hold" action when the expense is already in Hold status. What is the root cause of that problem?In App/src/libs/TransactionUtils/index.ts Lines 703 to 709 in 3047c1b
We check if a transaction is on hold if either: transaction has a The second condition returns Lines 8261 to 8270 in 3047c1b
and App/src/libs/TransactionUtils/index.ts Lines 689 to 697 in 3047c1b
so we only need to focus on the first condition. When an admin resolves an employee's duplicate, we call Line 8233 in 3047c1b
Let's look at the onyx data returned by server when online: We see that it sets a What changes do you think we should make in order to solve the problem?Update The logic should be added in this loop: Line 8291 in 3047c1b
Pseudo code: const optimisticHoldTransactionActions = []
const failureHoldTransactionActions = []
transactionThreadReportIDList.forEach((transactionThreadReportID) => {
const createdReportAction = ReportUtils.buildOptimisticHoldReportAction();
reportActionIDList.push(createdReportAction.reportActionID);
const transactionID = TransactionUtils.getTransactionID(transactionThreadReportID ?? '-1');
optimisticHoldTransactionActions.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
value: {
comment: {
hold: createdReportAction.reportActionID,
},
},
});
failureHoldTransactionActions.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
value: {
comment: {
hold: null,
},
},
}); What alternative solutions did you explore? (Optional) |
Since all of these actions happen offline this issue is in the front-end and can therefore be fixed externally. |
Job added to Upwork: https://www.upwork.com/jobs/~021840780088904015602 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The hold action is not updated optimistically if we resolve duplicates while offline What is the root cause of that problem?We should the unhold button only when we have App/src/libs/TransactionUtils/index.ts Line 708 in 3047c1b
Now when we resolve duplicates in the function here, we do not optimistically set the hold status which is required. We only get that when the What changes do you think we should make in order to solve the problem?To address this bug we should update the Note:
So the correct and updated code should be as follows: --- a/src/libs/actions/IOU.ts
+++ b/src/libs/actions/IOU.ts
@@ -8291,22 +8291,48 @@ function resolveDuplicates(params: TransactionMergeParams) {
transactionThreadReportIDList.forEach((transactionThreadReportID) => {
const createdReportAction = ReportUtils.buildOptimisticHoldReportAction();
reportActionIDList.push(createdReportAction.reportActionID);
+ const transactionID = TransactionUtils.getTransactionID(transactionThreadReportID ?? '-1');
optimisticHoldActions.push(
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
value: {
[createdReportAction.reportActionID]: createdReportAction,
},
+ },
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
+ value: {
+ pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
+ comment: {
+ hold: null,
+ },
+ },
+ },
+ );
failureHoldActions.push(
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
value: {
[createdReportAction.reportActionID]: {
errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericHoldExpenseFailureMessage'),
},
},
},
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
+ value: {
+ pendingAction: null,
+ comment: {
+ hold: null,
+ },
+ errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericHoldExpenseFailureMessage'),
+ },
},
What alternative solutions did you explore? (Optional) |
@eVoloshchak, @stephanieelliott, @jasperhuangg Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@eVoloshchak Please review proposals! |
@eVoloshchak @jasperhuangg PR is ready for review. |
@eVoloshchak the PR is waiting on your review, can you take a look? |
^^ Bump @eVoloshchak |
Hey @eVoloshchak this PR is blocked on you, can you review please? #50383 |
I can review PR if needed |
PR is on staging! |
This doesn't appear to be fixed by the PR as the original issue is still reproducible on Mobile Web: #50383 (comment) |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.52-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-10-30. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
Payment Summary
BugZero Checklist (@stephanieelliott)
|
Summarizing payment on this issue:
Upwork job is here: https://www.upwork.com/jobs/~021851909474139768777 |
@stephanieelliott accepted thx |
All paid! |
@stephanieelliott @jasperhuangg Be sure to fill out the Contact List! |
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.0.41-1
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was found when executing this PR: #48522
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Since the other expense has "Hold" action, the report header should have the "Unhold" action.
Actual Result:
The report header has "Hold" action when the expense is already in Hold status.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6617758_1727464896179.20240928_031804.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @stephanieelliottThe text was updated successfully, but these errors were encountered: