Skip to content

[Due for Payment 2026-04-09][$250] Group Split - No RBR on split review after a smartscan fails #80419

Closed

Description

@nlemma

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.3.8-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-3390/folder/13176944/41237731/1146028429
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 10/Chrome
App Component: Chat Report View

Action Performed:

  1. Sign in to the ND app
  2. Create a group chat with two other existing accounts, and send a message in the chat
  3. Split a scan expense in the group chat, uploading an image that will fail the scan
  4. When the scan is finished, observe the split preview in the group chat

Expected Result:

Verify that a RBR red dot is added to the split preview in the group DM

Actual Result:

No RBR after smart scan fail

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7056951_1769230725977.rbr.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022015012108776614909
  • Upwork Job ID: 2015012108776614909
  • Last Price Increase: 2026-01-31
Issue OwnerCurrent Issue Owner: @abdulrahuman5196

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 24, 2026
  2. changed the title [-]Group Split - No RBR on split review after a smartscan fails[/-] [+][$250] Group Split - No RBR on split review after a smartscan fails[/+] on Jan 24, 2026
  3. melvin-bot commented on Jan 24, 2026

    @melvin-bot
  4. melvin-bot commented on Jan 24, 2026

    @melvin-bot

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

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 24, 2026
  6. melvin-bot commented on Jan 24, 2026

    @melvin-bot

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

  7. yatin-italy commented on Jan 24, 2026

    @yatin-italy

    Proposal

    Restate the problem this issue is trying to solve.

    When a smart scan fails for a split expense in a group chat, the split preview does not show the Red Brick Road error indicator. The preview renders, but the red dot is missing even though the split transaction contains a receipt error.

    What is the root cause of that problem?

    The earliest wrong assumption is that the transaction preview should prefer the parent transaction over the split transaction. In src/components/ReportActionItem/TransactionPreview/index.tsx, the code assumes originalTransaction is the correct source of truth. This is wrong because smart scan errors are stored on the split transaction itself. Passing the parent transaction causes the error check to run on a transaction without errors, which directly suppresses the Red Brick Road indicator.

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

    Update the transaction passed to TransactionPreviewContent so it always reflects the split transaction.

    File: src/components/ReportActionItem/TransactionPreview/index.tsx

    Current code:

    transaction={originalTransaction ?? transaction}

    Updated code:

    transaction={transaction}

    TransactionPreviewContent already supports split bills correctly. It checks errors on the child transaction and internally resolves the parent transaction when needed.

    What alternative solutions did you explore? (Optional)

    None. TransactionPreviewContent is designed to receive the split transaction. Passing the parent transaction bypasses the intended error handling logic.

  8. nkdengineer commented on Jan 25, 2026

    @nkdengineer
    Contributor

    Proposal

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

    No RBR after smart scan fail

    What is the root cause of that problem?

    After a scan split in the group chat failed, the backend only updates the receipt's state to failed. We already have hasFieldErrors check

    const hasFieldErrors = hasMissingSmartscanFields(transaction, iouReport);

    function hasMissingSmartscanFields(transaction: OnyxInputOrEntry<Transaction>, transactionReport: OnyxEntry<Report>): boolean {
    return !!(transaction && !isDistanceRequest(transaction) && !isReceiptBeingScanned(transaction) && areRequiredFieldsEmpty(transaction, transactionReport));
    }

    But areRequiredFieldsEmpty check skipped the amount missing check when the zero expense beta is enabled. It's incorrect since the zero expense is only available in the workspace

    function areRequiredFieldsEmpty(transaction: OnyxEntry<Transaction>, transactionReport: OnyxEntry<Report>): boolean {
    const isFromExpenseReport = transactionReport?.type === CONST.REPORT.TYPE.EXPENSE;
    if (Permissions.isBetaEnabled(CONST.BETAS.ZERO_EXPENSES, allBetas)) {
    return (isFromExpenseReport && isMerchantMissing(transaction)) || isCreatedMissing(transaction);
    }
    return (isFromExpenseReport && isMerchantMissing(transaction)) || isAmountMissing(transaction) || isCreatedMissing(transaction);
    }

    function isAmountMissing(transaction: OnyxEntry<Transaction>) {
    if (Permissions.isBetaEnabled(CONST.BETAS.ZERO_EXPENSES, allBetas)) {
    return transaction?.amount === undefined && (!transaction?.modifiedAmount === undefined || transaction?.modifiedAmount === '');
    }
    return (transaction?.amount === 0 || transaction?.amount === undefined) && (!transaction?.modifiedAmount || transaction?.modifiedAmount === 0 || transaction?.modifiedAmount === '');
    }

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

    We should only skip the amount missing check if the expense is from the expense report

    function areRequiredFieldsEmpty(transaction: OnyxEntry<Transaction>, transactionReport: OnyxEntry<Report>): boolean {
        const isFromExpenseReport = transactionReport?.type === CONST.REPORT.TYPE.EXPENSE;
        if (Permissions.isBetaEnabled(CONST.BETAS.ZERO_EXPENSES, allBetas) && isFromExpenseReport) {
            return (isFromExpenseReport && isMerchantMissing(transaction)) || isCreatedMissing(transaction);
        }
        return (isFromExpenseReport && isMerchantMissing(transaction)) || isAmountMissing(transaction, isFromExpenseReport) || isCreatedMissing(transaction);
    }
    
    

    function areRequiredFieldsEmpty(transaction: OnyxEntry<Transaction>, transactionReport: OnyxEntry<Report>): boolean {
    const isFromExpenseReport = transactionReport?.type === CONST.REPORT.TYPE.EXPENSE;
    if (Permissions.isBetaEnabled(CONST.BETAS.ZERO_EXPENSES, allBetas)) {
    return (isFromExpenseReport && isMerchantMissing(transaction)) || isCreatedMissing(transaction);
    }
    return (isFromExpenseReport && isMerchantMissing(transaction)) || isAmountMissing(transaction) || isCreatedMissing(transaction);
    }

    And we also need to do the same in isAmountMissing function by introducing isFromExpenseReport parameter

    function isAmountMissing(transaction: OnyxEntry<Transaction>, isFromExpenseReport = true) {
        if (Permissions.isBetaEnabled(CONST.BETAS.ZERO_EXPENSES, allBetas) && isFromExpenseReport) {
            return transaction?.amount === undefined && (!transaction?.modifiedAmount === undefined || transaction?.modifiedAmount === '');
        }
        return (transaction?.amount === 0 || transaction?.amount === undefined) && (!transaction?.modifiedAmount || transaction?.modifiedAmount === 0 || transaction?.modifiedAmount === '');
    }
    

    function isAmountMissing(transaction: OnyxEntry<Transaction>) {
    if (Permissions.isBetaEnabled(CONST.BETAS.ZERO_EXPENSES, allBetas)) {
    return transaction?.amount === undefined && (!transaction?.modifiedAmount === undefined || transaction?.modifiedAmount === '');
    }
    return (transaction?.amount === 0 || transaction?.amount === undefined) && (!transaction?.modifiedAmount || transaction?.modifiedAmount === 0 || transaction?.modifiedAmount === '');
    }

    OPTIONAL: We should also update the RBR message to display missing amount/review requiredinstead when the merchant isn't required.

    if (hasFieldErrors && RBRMessage === undefined) {
            const merchantMissing = isMerchantMissing(transaction);
            if (merchantMissing && isPaidGroupPolicy) {
                RBRMessage = {translationPath: 'iou.missingMerchant'};
            } else if (isAmountMissing(transaction, isPaidGroupPolicy)) {
                RBRMessage = {translationPath: 'iou.missingAmount'};
            }
        }
    

    if (hasFieldErrors && RBRMessage === undefined) {
    const merchantMissing = isMerchantMissing(transaction);
    if (merchantMissing) {
    RBRMessage = {translationPath: 'iou.missingMerchant'};
    }

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  9. melvin-bot commented on Jan 28, 2026

    @melvin-bot

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

  10. 33 remaining items

  11. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  12. mallenexpensify commented on Apr 17, 2026

    @mallenexpensify
    Contributor

    @abdulrahuman5196 plz complete the BZ checklist and tag me in a post once you have. Thx

  13. abdulrahuman5196 commented on Apr 17, 2026

    @abdulrahuman5196
    Contributor

    Checking now

  14. abdulrahuman5196 commented on Apr 17, 2026

    @abdulrahuman5196
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: [BETA] Allow zero-amount expenses - ROUND 5 #79197
      Link to the comment on the Issue: https://github.com/Expensify/App/pull/79197/changes#r3103036807

    • [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.

    Regression Test Proposal Template

    Regression Test Proposal

    Precondition:

    Test:

    1. Sign in to the ND app
    2. Create a group chat with two other existing accounts, and send a message in the chat
    3. Split a scan expense in the group chat, uploading an image that will fail the scan
    4. When the scan is finished, observe the split preview in the group chat
    5. Verify that a RBR red dot is added to the split preview in the group DM

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-83a6-a872-143b-08f0ad65bbb4
  15. abdulrahuman5196 commented on Apr 17, 2026

    @abdulrahuman5196
    Contributor

    @mallenexpensify Completed the checklist

  16. mallenexpensify commented on Apr 20, 2026

    @mallenexpensify
    Contributor

    Thx @abdulrahuman5196 , when ya fill out the checkilst, please follow this step too (saves me a tiny bit o ftime)
    <!-- AFTER FILLING THIS OUT, be sure to remove the <details> tags!!!!! -->

  17. twisterdotcom commented on Apr 22, 2026

    @twisterdotcom
    Contributor

    @nkdengineer has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-4ddf-a3d7-86fc-e79a9230a144
  18. laurenreidexpensify commented on Apr 27, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @abdulrahuman5196

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