Open IuliiaHerets opened 2 hours ago
Triggered auto assignment to @muttmuure (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.
RBR is not shown on the report preview when money request is dupe.
The RBR doesn't show on the report preview because it only shows if the dupe detection permission is enabled. IF the account doesn't have the permission, then RBR won't show. https://github.com/Expensify/App/blob/5e69bfc36ddfd82a113606257abb93f2fa78f7db/src/components/ReportActionItem/ReportPreview.tsx#L156-L160 https://github.com/Expensify/App/blob/5e69bfc36ddfd82a113606257abb93f2fa78f7db/src/libs/TransactionUtils/index.ts#L832-L842
However, on the individual expense preview, we just checks for the amount of the duplicates violation without checking whether the permission is enabled or not, which is different form hasWarningTypeViolations
.
https://github.com/Expensify/App/blob/5e69bfc36ddfd82a113606257abb93f2fa78f7db/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx#L147-L149
So, I think there are 2 issues here. In ReportPreview, we check for warning type violation. In MoneyRequestPreviewContent, we don't check for warning type violation, but we check for duplicates, ignoring the dupe detection permission.
Let's use hasWarningTypeViolations
in MoneyRequestPreviewContent too.
const hasWarningTypeViolations = TransactionUtils.hasWarningTypeViolation(transaction?.transactionID ?? '-1', transactionViolations);
...
const shouldShowRBR = hasNoticeTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold) || hasWarningTypeViolations;
(MoneyRequestPreviewContent also checks for hasNoticeTypeViolation but ReportPreview don't. We can add it to ReportPreview too if needed by adding it to ReportUtils, just like the others, but I don't know how to trigger notice type violation, so not sure.)
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: v9.0.59-0 Reproducible in staging?: Y Reproducible in production?: Y Issue was found when executing this PR: https://github.com/Expensify/App/pull/48958 Email or phone of affected tester (no customers): dave0123seife@gmail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
RBR(red dot) is shown in LHN and also in the report because of the dupe expense.
Actual Result:
RBR(red dot) is not shown in LHN and in the report. RBR is only shown inside the expense report
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/6067710d-aceb-409e-b71b-b12145014331
View all open jobs on GitHub