Skip to content

[HOLD for payment 2024-07-24] [$250] [One expense reports] Red dot on LHN does not appear for participant when create 1:1 hold expense #43760

Closed

Description

@lanitochka17

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: 1.4.83-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: https://expensify.testrail.io/index.php?/tests/view/4627347&group_by=cases:section_id&group_order=asc&group_id=309128
Email or phone of affected tester (no customers): gocemate+a271@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

Submitter

  1. Create an IOU with several expenses in a 1:1 with another user you have access to
    Participant
  2. Log in as the other user
  3. Navigate to a expense, click the three dots in the header, and choose Hold
  4. Leave a hold comment and confirm

Expected Result:

There should be a red dot on LHN on participant side

Actual Result:

Red dot on LHN does not appear for participant when create 1:1 hold expense

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

Bug6512986_1718358239458.Recording__3217.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0161264d9154f7a521
  • Upwork Job ID: 1802728525946815546
  • Last Price Increase: 2024-07-01
  • Automatic offers:
    • truph01 | Contributor | 103017602
Issue OwnerCurrent Issue Owner: @lschurr

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 14, 2024
  2. melvin-bot commented on Jun 14, 2024

    @melvin-bot

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

  3. lanitochka17 commented on Jun 14, 2024

    @lanitochka17
    Author

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

  4. truph01 commented on Jun 14, 2024

    @truph01
    Contributor

    Proposal

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

    Red dot on LHN does not appear for participant when create 1:1 hold expense

    What is the root cause of that problem?

    • We early return false in this logic:

      App/src/libs/ReportUtils.ts

      Lines 5278 to 5280 in 75c104b

      if (!isCurrentUserSubmitter(IOUReportID)) {
      return false;
      }

      if the current user is not submitter, that leads to there is no RBR displays for participant when creating 1:1 hold expense.

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

    • With the new feature mentioned in this comment, we need to make two change:
    1. Change the getOrderedReportIDs to make sure with the oneTransactionReport will be pinned if its transaction has violations.
    • We need to update:
      const hasErrorsOtherThanFailedReceipt =
      doesReportHaveViolations || Object.values(allReportErrors).some((error) => error?.[0] !== Localize.translateLocal('iou.error.genericSmartscanFailureMessage'));

      to:
            const transactionReportActions = ReportActionsUtils.getAllReportActions(report.reportID);
            const oneTransactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, transactionReportActions, undefined);
            let doesTransactionThreadReportHasViolations = false;
            if (oneTransactionThreadReportID) {
                const transactionReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${oneTransactionThreadReportID}`];
                doesTransactionThreadReportHasViolations = OptionsListUtils.shouldShowViolations(transactionReport, betas ?? [], transactionViolations);
            }
            const hasErrorsOtherThanFailedReceipt =
                doesTransactionThreadReportHasViolations ||
                doesReportHaveViolations ||
                Object.values(allReportErrors).some((error) => error?.[0] !== Localize.translateLocal('iou.error.genericSmartscanFailureMessage'));
    
    1. Change the getOptionData function to make sure the RBR is displayed in oneTransactionReport in LHN if its transaction has violations.
    • We need to update:
      result.brickRoadIndicator = hasErrors || hasViolations ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';

      to:
        result.brickRoadIndicator = hasErrors || hasViolations ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';
        const oneTransactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, ReportActionsUtils.getAllReportActions(report.reportID));
        if (oneTransactionThreadReportID) {
            const oneTransactionThreadReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${oneTransactionThreadReportID}`];
            if (
                Permissions.canUseViolations(betas) &&
                ReportUtils.shouldDisplayTransactionThreadViolations(
                    oneTransactionThreadReport,
                    transactionViolations,
                    ReportActionsUtils.getAllReportActions(report.reportID)[oneTransactionThreadReport?.parentReportActionID ?? '-1'],
                )
            ) {
                result.brickRoadIndicator = CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
            }
        }
    
    • The above changes are just the main changes, if need I can raise a draft branch for it.

    What alternative solutions did you explore? (Optional)

        const transaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${IOUTransactionID}`] ?? {};
        const isOnHold = TransactionUtils.isOnHold(transaction);
        if (!isCurrentUserSubmitter(IOUReportID) && !isOnHold) {
            return false;
        }
    
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 17, 2024
  6. changed the title [-]Hold - Red dot on LHN does not appear for participant when create 1:1 hold expense[/-] [+][$250] Hold - Red dot on LHN does not appear for participant when create 1:1 hold expense[/+] on Jun 17, 2024
  7. melvin-bot commented on Jun 17, 2024

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 17, 2024
  9. melvin-bot commented on Jun 17, 2024

    @melvin-bot

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

  10. Pujan92 commented on Jun 19, 2024

    @Pujan92
    Contributor

    @lschurr Based on this comment it seems only for the submitter we are showing Red dot(RBR) in LHN. Would like to confirm the expected result here.
    cc: @cead22

  11. 36 remaining items

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jul 17, 2024
  13. changed the title [-][$250] [One expense reports] Red dot on LHN does not appear for participant when create 1:1 hold expense[/-] [+][HOLD for payment 2024-07-24] [$250] [One expense reports] Red dot on LHN does not appear for participant when create 1:1 hold expense[/+] on Jul 17, 2024
  14. melvin-bot commented on Jul 17, 2024

    @melvin-bot

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

  15. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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-07-24. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jul 17, 2024

    @melvin-bot

    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:

    • [@Pujan92] The PR that introduced the bug has been identified. Link to the PR:
    • [@Pujan92] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • [@Pujan92] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • [@Pujan92] Determine if we should create a regression test for this bug.
    • [@Pujan92] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. Pujan92 commented on Jul 24, 2024

    @Pujan92
    Contributor

    We don't have an offending PR here as it is kind of a new thing for the one expense report.

    Regression Test Steps

    1. Submit a first expense for any of the participant
    2. Hold that expense / Violate it by skipping required fields(category/tag..) if it is the policy expense chat
    3. Verify the one expense report in the LHN has the RBR and is pinned.

    Do you agree 👍 or 👎 ?

  18. lschurr commented on Jul 24, 2024

    @lschurr
    Contributor

    Payment summary:

  19. moved this from Release 2: Summer 2024 (Aug) to Done in [#whatsnext] #wave-collecton Jul 24, 2024
  20. JmillsExpensify commented on Jul 25, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @Pujan92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions