Skip to content

RBR is shown in the report preview for the pending card transaction even though these reports can be approved #53026

Closed

Description

@m-natarajan

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:
Reproducible in staging?:
Reproducible in production?:
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @tgolen
Slack conversation (hyperlinked to channel name): expensify bugs

Action Performed:

  1. Submit a card expense to the approver
  2. As a approver open the expense (card expense is not merged yet)
  3. Observe there is a GBR in the LHN and RBR in the report preview

Expected Result:

Since the card transaction can be approved even in if the card transaction is in pending state there should be GBR

Actual Result:

RBR is shown for the card transactions
It would be nice then if it was a green dot and the text was more like "Approve without waiting for credit card merge [APPROVE]"

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

image (15)

View all open jobs on GitHub

Activity

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

    @melvin-bot

    Triggered auto assignment to @jliexpensify (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. MelvinBot commented on Nov 23, 2024

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  4. cretadn22 commented on Nov 24, 2024

    @cretadn22
    Contributor

    Proposal

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

    RBR is shown in the report preview for the pending card transaction even though these reports can be approved

    What is the root cause of that problem?

    const hasErrors =
    (hasMissingSmartscanFields && !iouSettled) ||
    // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
    ReportUtils.hasViolations(iouReportID, transactionViolations, true) ||
    ReportUtils.hasNoticeTypeViolations(iouReportID, transactionViolations, true) ||
    ReportUtils.hasWarningTypeViolations(iouReportID, transactionViolations, true) ||
    (ReportUtils.isReportOwner(iouReport) && ReportUtils.hasReportViolations(iouReportID)) ||
    ReportUtils.hasActionsWithErrors(iouReportID);

    We are currently using the hasErrors field as the condition to display the RBR on the report preview. However, we have not yet included conditions to account for pending card transactions

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

    The main solution: Display GBR instead of RBR

    The hasErrors field should be set to false if hasAllPendingRTERViolations is true.

    const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every((t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t));

    const hasAllPendingRTERViolations = TransactionUtils.allHavePendingRTERViolation([transaction?.transactionID ?? '-1']);

    const hasErrors = (.....)   &&  !hasAllPendingRTERViolations
    
    OR
    
    const hasErrors = (.....)   &&  !hasAllPendingRTERViolations && !hasOnlyPendingTransactions 
    
    

    Additionally, we need to include the conditions (.... && hasAllPendingRTERViolations && hasOnlyPendingTransactions) to display GBR.

    {!shouldShowRBR && shouldPromptUserToAddBankAccount && (

    Note: The hasAllPendingRTERViolations condition is sufficient to fix this issue, while hasOnlyPendingTransactions is optional.

    What alternative solutions did you explore? (Optional)

    The alternative solution: Hide RBR

    The hasErrors field should be set to false if hasAllPendingRTERViolations is true.

    const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every((t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t));

    const hasAllPendingRTERViolations = TransactionUtils.allHavePendingRTERViolation([transaction?.transactionID ?? '-1']);

    const hasErrors = (.....)   &&  !hasAllPendingRTERViolations
    
    OR
    
    const hasErrors = (.....)   &&  !hasAllPendingRTERViolations && !hasOnlyPendingTransactions
    
    
  5. jliexpensify commented on Nov 24, 2024

    @jliexpensify
    Contributor

    Tagging in @Expensify/design to weigh in on any thoughts on text/how we communicate this to users. This sounds like a new feature.

  6. dubielzyk-expensify commented on Nov 25, 2024

    @dubielzyk-expensify
    Contributor

    I've read the Slack thread, I'm not 100% sure what the right move here is. I think the confusing thing is that we have GBR in LHN and RBR on the report. This feels conflicting. cc @JmillsExpensify and @trjExpensify here too

  7. shawnborton commented on Nov 25, 2024

    @shawnborton
    Contributor

    Yeah, I'm not sure what the best answer is either, curious for Jason & Tom's thoughts.

    Also cc @dannymcclain this is another place where we need to consider how the category/tag line on an expense preview will look alongside this "Receipt pending match with card transaction" message...

  8. dannymcclain commented on Nov 25, 2024

    @dannymcclain
    Contributor

    Good call. I'm a bit confused though—I was initially going to say we could treat it the same way as the pending card transaction with something next to the "Card" eyebrow: Card • Pending or Card • Receipt matching or something... But looking at the screenshot, that preview looks like it's a report preview, not an expense preview? The eyebrow text "NewDot Test EC Feed only - Expensify coffee owes:" is worded like a report, not an expense? Have I lost all my marbles here?

  9. shawnborton commented on Nov 25, 2024

    @shawnborton
    Contributor

    Ah good observation, I think you are right. I'd be curious what this one looks like at the expense level, if it even exists? cc @grgia for thoughts there

  10. trjExpensify commented on Nov 26, 2024

    @trjExpensify
    Contributor

    Yeah, I'm not sure what the best answer is either, curious for Jason & Tom's thoughts.

    We're removing the GBR that's showing to the approver if all the transactions on the report are pending in this issue, because there's not really any action for them to take yet. The PR for that is up for review.

  11. JmillsExpensify commented on Nov 27, 2024

    @JmillsExpensify
    Contributor

    What Tom said.

  12. 1 remaining item

  13. JmillsExpensify commented on Nov 27, 2024

    @JmillsExpensify
    Contributor

    I would say that the answer to that question is yes, as you still need to fix issues/violations if they are present (and as long as the underlying report is not closed/reimbursed).

    That said, I want to make sure that this initiative remains consistent with this issue, and this comment in particular.

  14. trjExpensify commented on Nov 27, 2024

    @trjExpensify
    Contributor

    Okay cool, so the report in this context with only pending transactions on it isn't reimbursed or closed, so the red dot should appear, right?

    Red dots appear on expense report and transaction preview components as long as violations/rules have been broken and the report is not reimbursed or closed.

  15. JmillsExpensify commented on Nov 27, 2024

    @JmillsExpensify
    Contributor

    Do we only close the report once the transaction is posted? If so, then yes your statement sounds right to me.

  16. trjExpensify commented on Nov 28, 2024

    @trjExpensify
    Contributor

    In the instant+no approvals case? Yah.

    image
  17. melvin-bot commented on Nov 28, 2024

    @melvin-bot

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

  18. melvin-bot commented on Dec 2, 2024

    @melvin-bot

    @jliexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  19. jliexpensify commented on Dec 2, 2024

    @jliexpensify
    Contributor

    Apologies, just catching up here - so if I'm understanding correctly, we want to move forward with fixing this so the 🔴 appears in the LHN?

  20. trjExpensify commented on Dec 4, 2024

    @trjExpensify
    Contributor

    For which user now?

  21. jliexpensify commented on Dec 4, 2024

    @jliexpensify
    Contributor

    Sorry, the LHN for the approver (i.e. @tgolen in this case)

  22. trjExpensify commented on Dec 4, 2024

    @trjExpensify
    Contributor

    Gotcha. Nope, it should not.

    image
  23. dannymcclain commented on Dec 5, 2024

    @dannymcclain
    Contributor

    So @trjExpensify is there anything here that actually needs to be fixed? I'm getting quite confused.

  24. trjExpensify commented on Dec 5, 2024

    @trjExpensify
    Contributor

    I don't think so, because the GBR in the LHN is being removed in this issue: #52315

  25. jliexpensify commented on Dec 5, 2024

    @jliexpensify
    Contributor

    Awesome, thanks Tom - closing!

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Needs ReproductionReproducible steps needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions