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

[$250] RBR - No RBR is shown on LHN for combined IOU with a violation #44879

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 5, 2024 · 15 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 5, 2024

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.4.0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #43502

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Create a workspace
  3. Make categories mandatory for the workspace
  4. Go to workspace chat and submit an IOU without a category
  5. Open the transaction thread of the submitted IOU with a violation

Expected Result:

RBR gets shown on LHN of the transaction thread with a violation

Actual Result:

No RBR is being shown on the LHN of the transaction thread with a violation

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

Bug6533104_1720098042352.bandicam_2024-07-04_12-24-23-366.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015f3eae4bbca8b711
  • Upwork Job ID: 1811797461017755637
  • Last Price Increase: 2024-07-19
Issue OwnerCurrent Issue Owner: @rayane-djouah
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 5, 2024
Copy link

melvin-bot bot commented Jul 5, 2024

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.

@lanitochka17
Copy link
Author

@muttmuure 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

@bernhardoj
Copy link
Contributor

Proposal

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

There is no RBR for one transaction report when there is a violation.

What is the root cause of that problem?

The RBR will show if there are errors or violations.

result.brickRoadIndicator = hasErrors || hasViolations ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';

The app will check the violations from the current report and its parent report action.

const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction);

However, because we are checking the one-transaction report (or the expense report), the violations are empty.

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

We should check the transaction thread report violations if it's a one-transaction report. To do that, we need to pass the thread report and the thread parent report action from LHNOptionsList down to OptionRowLHNData.

const renderItem = useCallback(
({item: reportID}: RenderItemProps): ReactElement => {
const itemFullReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
const itemReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`];
const itemParentReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${itemFullReport?.parentReportID}`];
const itemParentReportAction = itemParentReportActions?.[itemFullReport?.parentReportActionID ?? '-1'];
const itemPolicy = policy?.[`${ONYXKEYS.COLLECTION.POLICY}${itemFullReport?.policyID}`];
const transactionID = ReportActionsUtils.isMoneyRequestAction(itemParentReportAction)
? ReportActionsUtils.getOriginalMessage(itemParentReportAction)?.IOUTransactionID ?? '-1'
: '-1';
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
const hasDraftComment = DraftCommentUtils.isValidDraftComment(draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`]);
const sortedReportActions = ReportActionsUtils.getSortedReportActionsForDisplay(itemReportActions);
const lastReportAction = sortedReportActions[0];
// Get the transaction for the last report action
let lastReportActionTransactionID = '';
if (ReportActionsUtils.isMoneyRequestAction(lastReportAction)) {
lastReportActionTransactionID = ReportActionsUtils.getOriginalMessage(lastReportAction)?.IOUTransactionID ?? '-1';
}
const lastReportActionTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${lastReportActionTransactionID}`];
return (
<OptionRowLHNData
reportID={reportID}

const itemOneTransactionThreadReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${ReportActionsUtils.getOneTransactionThreadReportID(reportID, itemReportActions)}`];
const itemOneTransactionParentReportAction = itemOneTransactionThreadReport ? itemReportActions?.[itemOneTransactionThreadReport?.parentReportActionID ?? '-1'] : {};

Then, we prioritize of using the transaction thread report and transaction thread parent report action here.

const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction);

const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(oneTransactionThreadReport ?? fullReport, transactionViolations, oneTransactionParentReportAction?? parentReportAction);

Copy link

melvin-bot bot commented Jul 8, 2024

@muttmuure Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Jul 10, 2024

@muttmuure Huh... This is 4 days overdue. Who can take care of this?

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Jul 12, 2024
@melvin-bot melvin-bot bot changed the title RBR - No RBR is shown on LHN for combined IOU with a violation [$250] RBR - No RBR is shown on LHN for combined IOU with a violation Jul 12, 2024
Copy link

melvin-bot bot commented Jul 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~015f3eae4bbca8b711

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

melvin-bot bot commented Jul 12, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 12, 2024
@muttmuure muttmuure moved this to Release 2: Summer 2024 (Aug) in [#whatsnext] #expense Jul 12, 2024
@Pujan92
Copy link
Contributor

Pujan92 commented Jul 12, 2024

This issue seems similar to #43760 and it got fixed here.

Copy link

melvin-bot bot commented Jul 15, 2024

@muttmuure, @rayane-djouah Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Jul 15, 2024
@rayane-djouah
Copy link
Contributor

Not reproducible on staging:

Screenshot 2024-07-15 at 10 49 58 PM

cc @muttmuure

@melvin-bot melvin-bot bot removed the Overdue label Jul 15, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

@muttmuure @rayane-djouah this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Jul 19, 2024

@muttmuure, @rayane-djouah Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@rayane-djouah
Copy link
Contributor

@muttmuure - We can close this one

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2024
@github-project-automation github-project-automation bot moved this from Release 2: Summer 2024 (Aug) to Done in [#whatsnext] #expense Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Archived in project
Development

No branches or pull requests

5 participants