Skip to content

[Due for payment 2025-03-03] [$250] Report - The report preview component in the workspace chat have NO red dot #56889

Closed

Description

@vincdargento

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.98-7
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/runs/view/31059/&group_by=cases:section_id&group_id=316343
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Win 11
App Component: Money Requests

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Login as the member of the Workspace
  3. Navigate to the workspace chat
  4. Go to (+) > Create Expense
  5. Request money with the following info
  • Amount: $50.00
  • Merchant: Starbucks
  1. Create a second request with the same information
  • Amount: $50.00
  • Merchant: Starbucks

Expected Result:

The report preview component in the workspace chat contains a red dot

Actual Result:

The report preview component in the workspace chat have NO red dot

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021891656450308549168
  • Upwork Job ID: 1891656450308549168
  • Last Price Increase: 2025-02-18
  • Automatic offers:
    • dominictb | Reviewer | 106194169
    • truph01 | Contributor | 106194170
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (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. FitseTLT commented on Feb 14, 2025

    @FitseTLT
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-02-14 20:02:22 UTC.

    Proposal

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

    Report - The report preview component in the workspace chat have NO red dot

    What is the root cause of that problem?

    We show RBR for duplicate transactions in money request view because we show rbr for onHold expenses

    const shouldShowRBR = hasNoticeTypeViolations || hasWarningTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold);

    But for report previews we don't show RBR for held expenses here
    const hasErrors =
    (hasMissingSmartscanFields && !iouSettled) ||
    // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
    hasViolations(iouReportID, transactionViolations, true) ||
    hasNoticeTypeViolations(iouReportID, transactionViolations, true) ||
    hasWarningTypeViolations(iouReportID, transactionViolations, true) ||
    (isReportOwner(iouReport) && hasReportViolations(iouReportID)) ||
    hasActionsWithErrors(iouReportID);

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

    We should show RBR if there is a transaction on hold and the report is not fully approved or settled same as money request view here

    const shouldShowRBR = hasNoticeTypeViolations || hasWarningTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold);

     const isSettlementOrApprovalPartial = !!iouReport?.pendingFields?.partial;
    
        const isFullySettled = iouSettled && !isSettlementOrApprovalPartial;
        const isFullyApproved = isApproved && !isSettlementOrApprovalPartial;
    
        const hasErrors =
            (hasMissingSmartscanFields && !iouSettled) ||
            // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
            hasViolations(iouReportID, transactionViolations, true) ||
            hasNoticeTypeViolations(iouReportID, transactionViolations, true) ||
            hasWarningTypeViolations(iouReportID, transactionViolations, true) ||
            (isReportOwner(iouReport) && hasReportViolations(iouReportID)) ||
            hasActionsWithErrors(iouReportID) ||
            (transactions?.some((transaction) => isOnHold(transaction)) && !isFullyApproved && !isFullySettled);
    

    We can also show RBR for the workspace chat too in LHN similarly if a transaction under an iou report is on hold.

    Optionally we can also show the RBR only if there are duplicate transaction on the iou report instead

    ||
            transactions?.some((transaction) => isDuplicate(transaction.transactionID));
    

    BTW I have noticed more inconsistencies on the condition for which we show RBR on ReportPreview, Request Preview and LHN for instance we don't show notice type violations in LHN but we do for report preview and so on. So if needed we can make all the RBR conditions consistent.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N / A

    What alternative solutions did you explore? (Optional)

  4. mallenexpensify commented on Feb 15, 2025

    @mallenexpensify
    Contributor

    Asking for test case link in #QA cuz link in OP isn't working. I want to share the steps to confirm expected behaviour

  5. Kalydosos commented on Feb 15, 2025

    @Kalydosos
    Contributor

    Proposal

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

    The report preview component in the workspace chat have NO red dot

    What is the root cause of that problem?

    We do not display duplicates warnings as violations for reports previews

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

    To display duplicates warnings as violations we can just add an extra parameter here by changing the code from

    function hasWarningTypeViolation(transactionID: string | undefined, transactionViolations: OnyxCollection<TransactionViolation[]>, showInReview?: boolean): boolean {

    to

    function hasWarningTypeViolation(transactionID: string | undefined, transactionViolations: OnyxCollection<TransactionViolation[]>, showInReview?: boolean, includeDupes=false): boolean {

    and use the new parameter here, changing from

    if (hasOnlyDupeDetectionViolation) {

    to

    if (!includeDupes && hasOnlyDupeDetectionViolation) {

    then setting the new parameter value here from

    hasWarningTypeViolations(iouReportID, transactionViolations, true) ||

    to

    hasWarningTypeViolations(iouReportID, transactionViolations, true, true) ||

    RESULT

    Image

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    None

  6. IuliiaHerets commented on Feb 16, 2025

    @IuliiaHerets

    Hi, @mallenexpensify. You can use this link to TR steps.

  7. truph01 commented on Feb 17, 2025

    @truph01
    Contributor

    Proposal

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

    • The report preview component in the workspace chat have NO red dot

    What is the root cause of that problem?

    • This regression originates from PR Remove dupe detection beta, which enabled the dupe detection beta for everyone. In the process, the logic:

      if (!Permissions.canUseDupeDetection(allBetas ?? []) && hasOnlyDupeDetectionViolation) {
          return false;
      }

    was incorrectly updated in:

    if (hasOnlyDupeDetectionViolation) {
    return false;
    }

    • Since Permissions.canUseDupeDetection(allBetas ?? []) is always true after opening the beta to everyone, !Permissions.canUseDupeDetection(allBetas ?? []) is always false. However, instead of removing the entire condition, only !Permissions.canUseDupeDetection(allBetas ?? []) was removed.

    • As a result, hasWarningTypeViolation incorrectly returns false, causing ReportPreview to be displayed without RBR, as seen in:

      hasWarningTypeViolations(iouReportID, transactionViolations, true) ||

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

    • We just need to remove:

    if (hasOnlyDupeDetectionViolation) {
    return false;
    }

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    • We need to add the unit test for hasWarningTypeViolation in case there is only dupe detection violation and there is another violation then verify it returns true.

    What alternative solutions did you explore? (Optional)

  8. truph01 commented on Feb 17, 2025

    @truph01
    Contributor

    @mallenexpensify The behavior described in the expected behavior section is correct. This bug happened due to an accidental mistake when removing the dupe detection beta.

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 18, 2025
  10. changed the title [-]Report - The report preview component in the workspace chat have NO red dot[/-] [+][$250] Report - The report preview component in the workspace chat have NO red dot[/+] on Feb 18, 2025
  11. melvin-bot commented on Feb 18, 2025

    @melvin-bot
  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 18, 2025
  13. 16 remaining items

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Feb 24, 2025
  15. changed the title [-][$250] Report - The report preview component in the workspace chat have NO red dot[/-] [+][Due for payment 2025-03-03] [$250] Report - The report preview component in the workspace chat have NO red dot[/+] on Feb 24, 2025
  16. melvin-bot commented on Feb 24, 2025

    @melvin-bot

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

  17. melvin-bot commented on Feb 24, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.4-4 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 2025-03-03. 🎊

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

  18. melvin-bot commented on Feb 24, 2025

    @melvin-bot

    @dominictb @mallenexpensify @dominictb The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  19. dominictb commented on Feb 26, 2025

    @dominictb
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: https://github.com/Expensify/App/pull/53167/files#r1970851046

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes

    Regression Test Proposal

    Test:

    1. Open ND
    2. Login as the member of the Workspace
    3. Navigate to the workspace chat
    4. Go to (+) > Create Expense
    5. Request money with the following info
    • Amount: $50.00
    • Merchant: Starbucks
    1. Create a second request with the same information
    • Amount: $50.00
    • Merchant: Starbucks
    1. Verify: The report preview component in the workspace chat contains a red dot

    Do we agree 👍 or 👎

  20. tgolen commented on Mar 3, 2025

    @tgolen
    Contributor

    Sounds good to me!

  21. mallenexpensify commented on Mar 5, 2025

    @mallenexpensify
    Contributor

    Contributor: @truph01 paid $250 via Upwork
    Contributor+: @dominictb paid $250 via Upwork

    Test case here

    Thx!

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