-
Notifications
You must be signed in to change notification settings - Fork 3k
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-04-15] [Violations][$500] Scan - Category row shows violation briefly after the scan request is created #38131
Comments
Triggered auto assignment to @bfitzexpensify ( |
We think this bug might be related to #wave-collect - RELEASE 1 |
@bfitzexpensify 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. |
Hm, why wouldn't we show the category violation right away if categories are required on the workspace? 🤔 CC: @JmillsExpensify @cead22 |
Yes, I think the bug here is that the violation disappears, not that it appears in the first place. |
@trjExpensify do you agree with this comment? If so, I'll update the OP and send external |
Yeah, I agree with it insofar as I don't know why it's disappearing. This is violations related though, so one for #wave-control. :) |
It looks like this is happening because we compute missingTag/missingCategory/tagOutOfPolicy/categoryOutOfPolicy/someTagLevelsRequired violations on the client, and when the request to OpenReport comes back, it clears the violations in Onyx which makes them disappear. The reason violations are cleared is because we don't compute those violations when a transaction is a "partial transaction", meaning it's merchant is set to Let's make this issue external, have the contributors confirm that ^ is the root cause in their proposal, and see if adding a check for partial transactions in |
Job added to Upwork: https://www.upwork.com/jobs/~01e13a4e6b1d86de89 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Scan - Category row shows violation briefly after the scan request is created What is the root cause of that problem?We don't add a isScanning check before we fetch the violation: App/src/components/ReportActionItem/MoneyRequestView.tsx Lines 365 to 381 in a979d7d
In App/src/libs/Violations/ViolationsUtils.ts Line 128 in ba0816b
But here we do not consider the state of the transaction where the transaction is still scanning and is in Pending state, so for the first few seconds we display a missing tag violation but then OpenReport api call returns the data and the violation error is cleared
What changes do you think we should make in order to solve the problem?Add a const isScanning = hasReceipt && TransactionUtils.isReceiptBeingScanned(transaction); Then update <MenuItemWithTopDescription
description={translate('common.category')}
title={transactionCategory}
interactive={canEdit}
shouldShowRightIcon={canEdit}
titleStyle={styles.flex1}
onPress={() =>
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(CONST.IOU.ACTION.EDIT, CONST.IOU.TYPE.REQUEST, transaction?.transactionID ?? '', report.reportID),
)
}
- brickRoadIndicator={getErrorForField('category') ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR :
- undefined}
- error={getErrorForField('category')}
+ brickRoadIndicator={!isScanning && (getErrorForField('category') ?
+ CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined)}
+ error={isScanning ? undefined : getErrorForField('category')}
/>
What alternative solutions did you explore? (Optional)
We can directly update the App/src/libs/Violations/ViolationsUtils.ts Line 128 in ba0816b
Update the above to: const hasMissingCategoryViolation = transactionViolations.some((violation) => violation.name === 'missingCategory')
&& transaction?.status === CONST.TRANSACTION.STATUS.POSTED |
📣 @eh2077 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR is ready cc: @eh2077 |
Thanks for the explanation @eh2077 , appreciated 😄 |
Issue not reproducible during KI retests. (First week) |
Looks like we're close on the PR. |
The PR just hit staging. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 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-04-15. 🎊 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:
|
Checklist
Prerequisites:
Do you agree with the regression test above? 👍 or 👎 |
@eh2077 can you explain why that PR caused this regression? |
Thanks. I think that change actually happened before we were showing RBRs on partial transactions (I haven't confirmed). The linked PR was deployed in early Jan |
Payments complete - regression steps proposed in https://github.com/Expensify/Expensify/issues/388131. We're all done here, thanks everyone! |
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: 1.4.50-2
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: applause internal team
Action Performed:
Precondition:
Expected Result:
Category row will not show violation until after smartscanning is complete.
Actual Result:
Category row shows "missing category" violation briefly after the scan request is created.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6410628_1710216751744.20240312_120823.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: