Skip to content

[Due for payment 2026-10-16] [$175] Accounting- RBR appears on Both QBO rows after making an error on last row #102378

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.94-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: #101594
Email or phone of affected tester (no customers): duytestnguyen+389@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Pixel 7a Adnroid 17
App Component: Workspace Settings

Action Performed:

Preconditions:

  • Account with QBO connection on Workspace
  1. Open Hybrid app
  2. Go to Workspace setting
  3. Go to Accounting > Advance
  4. Turn 'Simulate failing network requests' on
  5. Tap on 'QuickBooks Online invoice collection account'
  6. Select any account in the list

Expected Result:

The RBR should appears on on 'QuickBooks Online invoice collection account' row

Actual Result:

The RBR appears on both "QuickBooks Online bill payment account", "QuickBooks Online invoice collection account" rows

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7270117_1790431316439.bandicam_2026-09-26_21-00-29-509.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7270117

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @parasharrajat

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 28, 2026
  2. MelvinBot commented on Sep 28, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The "bill payment account" row shows an RBR when either the reimbursement account or the collection account has an error.

    In QuickbooksAdvancedPage.tsx:35, reimbursementOrCollectionAccountIDs holds both reimbursementAccountID and collectionAccountID. The bill payment row uses that list for its RBR and pending state (lines 82-84).

    When the invoice collection account update fails, only errorFields.collectionAccountID is set. Both rows match it, so both show the RBR.

    This bug is older than MenuItem decomposition - section rows. That PR's base commit already had the same logic, so it's not a regression.

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

    In QuickbooksAdvancedPage.tsx, make the bill payment row use only CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID for subscribedSettings, brickRoadIndicator, and pendingAction. That matches the invoice collection row and the FX row, which each use only their own field. Then remove the unused reimbursementOrCollectionAccountIDs constant.

    This change keeps the toggle case working. When the "Reimbursed reports" toggle fails, both fields get errors and both rows still show the RBR.

    Supporting evidence
    • The bill payment selector writes and clears only REIMBURSEMENT_ACCOUNT_ID (QuickbooksAccountSelectPage.tsx:103-106).
    • The invoice selector writes and clears only COLLECTION_ACCOUNT_ID (QuickbooksInvoiceAccountSelectPage.tsx:104-107).
    • The "Reimbursed reports" toggle updates both keys (QuickbooksOnline.ts:534-542). On failure, buildOnyxDataForMultipleQuickbooksConfigurations sets an error on every updated key (QuickbooksOnline.ts:136-137). The bill payment row doesn't need to watch collectionAccountID to catch that case.
    • The same combined list also sets the bill payment row's pendingAction. So the row also greys out while only the collection account is saving. The fix above corrects that too.

    What alternative solutions did you explore? (Optional)

    None. A one-field-per-row mapping is the pattern the rest of this page already uses.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/102378) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 28, 2026
  4. melvin-bot commented on Sep 28, 2026

    @melvin-bot

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

  5. changed the title [-]Accounting- RBR appears on Both QBO rows after making an error on last row[/-] [+][$175] Accounting- RBR appears on Both QBO rows after making an error on last row[/+] on Sep 28, 2026
  6. melvin-bot commented on Sep 28, 2026

    @melvin-bot
  7. ashusatyarthi-wq commented on Sep 28, 2026

    @ashusatyarthi-wq

    Proposal

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

    In Workspace > Accounting > QuickBooks Online > Advanced, when an error occurs on the "QuickBooks Online invoice collection account" row (e.g. during a network failure), the Red Brick Road (RBR) error indicator appears on both the "QuickBooks Online bill payment account" row and the "QuickBooks Online invoice collection account" row, instead of only on the invoice collection account row.


    What is the root cause of that problem?

    In src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:

    Lines 35–37 define the error subscription keys:

    const reimbursementOrCollectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID, CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
    const collectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
    const fxExpenseAccounts = [CONST.QUICKBOOKS_CONFIG.FX_EXPENSE_ACCOUNT];

    The menu item configuration for the bill payment account row (qboBillPaymentAccount) uses reimbursementOrCollectionAccountIDs (lines 78–85):

    {
        key: 'qboBillPaymentAccount',
        title: selectedQboAccountName,
        description: translate('workspace.qbo.advancedConfig.qboBillPaymentAccount', integrationName),
        onPress: waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR.getRoute(policyID))),
        subscribedSettings: reimbursementOrCollectionAccountIDs,
        brickRoadIndicator: areSettingsInErrorFields(reimbursementOrCollectionAccountIDs, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
        pendingAction: settingsPendingAction(reimbursementOrCollectionAccountIDs, qboConfig?.pendingFields),
    },

    Because qboBillPaymentAccount configures strictly the reimbursement account (qboConfig?.reimbursementAccountID), subscribing it to [REIMBURSEMENT_ACCOUNT_ID, COLLECTION_ACCOUNT_ID] causes areSettingsInErrorFields to evaluate to true whenever errorFields.collectionAccountID is present.

    As a result, an error that belongs solely to the invoice collection account leaks to the bill payment account row, showing an unexpected RBR error on both rows.


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

    In src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:

    1. Replace reimbursementOrCollectionAccountIDs with reimbursementAccountIDs containing only CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID.
    2. Update the qboBillPaymentAccount menu item to subscribe solely to reimbursementAccountIDs.
    diff --git a/src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx b/src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
    --- a/src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
    +++ b/src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
    @@ -32,7 +32,7 @@ import React, {useMemo} from 'react';
     import {View} from 'react-native';
     
    -const reimbursementOrCollectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID, CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
    +const reimbursementAccountIDs = [CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID];
     const collectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
     const fxExpenseAccounts = [CONST.QUICKBOOKS_CONFIG.FX_EXPENSE_ACCOUNT];
     
    @@ -79,9 +79,9 @@ function QuickbooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
                 title: selectedQboAccountName,
                 description: translate('workspace.qbo.advancedConfig.qboBillPaymentAccount', integrationName),
                 onPress: waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR.getRoute(policyID))),
    -            subscribedSettings: reimbursementOrCollectionAccountIDs,
    -            brickRoadIndicator: areSettingsInErrorFields(reimbursementOrCollectionAccountIDs, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
    -            pendingAction: settingsPendingAction(reimbursementOrCollectionAccountIDs, qboConfig?.pendingFields),
    +            subscribedSettings: reimbursementAccountIDs,
    +            brickRoadIndicator: areSettingsInErrorFields(reimbursementAccountIDs, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
    +            pendingAction: settingsPendingAction(reimbursementAccountIDs, qboConfig?.pendingFields),
             },
             {
                 key: 'qboInvoiceCollectionAccount',

    What alternative solutions did you explore? (Optional)

    • Inline filtering within areSettingsInErrorFields: Unnecessary overhead. Each row in the accordion represents an independent setting with its own selector page, so subscribing each row strictly to its respective setting key matches the pattern used by qboInvoiceCollectionAccount and qboFxExpenseAccount.
  8. added a commit that references this issue on Sep 28, 2026
    1b2b202
  9. franklincg commented on Sep 28, 2026

    @franklincg

    Proposal

    Root cause

    The bill-payment row is subscribed to both QuickBooks fields:

    [reimbursementAccountID, collectionAccountID]

    even though that row only represents reimbursementAccountID. Because the row passes that combined list to both areSettingsInErrorFields() and settingsPendingAction(), a failed update to the invoice collection account also makes the bill-payment row show an RBR (and can make it appear pending).

    The two selectors already update independent fields, so the UI subscription is broader than the data each row owns.

    Fix

    In QuickbooksAdvancedPage.tsx:

    • replace the combined reimbursementOrCollectionAccountIDs list with a reimbursement-only list;
    • use that reimbursement-only list for the bill-payment row's subscribedSettings, brickRoadIndicator, and pendingAction;
    • keep the invoice row on collectionAccountID;
    • remove the now-unused combined constant.

    This preserves the reimbursed-reports toggle behavior: when that operation fails it writes errors to both fields, so each row will still independently show its own RBR.

    Validation

    I would cover the three relevant cases:

    1. collection-account failure → RBR only on invoice collection row;
    2. reimbursement-account failure → RBR only on bill-payment row;
    3. reimbursed-reports toggle failure → both rows show RBR because both fields fail.

    The same assertions should apply to pending state so a collection-only save does not gray out the bill-payment row.

  10. bonnhatnguyen commented on Sep 29, 2026

    @bonnhatnguyen

    Proposal

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

    In Workspace > Accounting > QuickBooks Online > Advanced, when a simulated network error or validation failure occurs on the "QuickBooks Online invoice collection account" row, the Red Brick Road (RBR) error indicator and pending state appear on both the "QuickBooks Online bill payment account" row and the "QuickBooks Online invoice collection account" row, instead of strictly on the invoice collection account row.


    What is the root cause of that problem?

    In src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:

    Lines 35–37 define setting subscriptions:

    const reimbursementOrCollectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID, CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
    const collectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
    const fxExpenseAccounts = [CONST.QUICKBOOKS_CONFIG.FX_EXPENSE_ACCOUNT];

    The menu item configuration for the bill payment account (qboBillPaymentAccount) uses reimbursementOrCollectionAccountIDs (lines 78–85):

    {
        key: 'qboBillPaymentAccount',
        title: selectedQboAccountName,
        description: translate('workspace.qbo.advancedConfig.qboBillPaymentAccount', integrationName),
        onPress: waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR.getRoute(policyID))),
        subscribedSettings: reimbursementOrCollectionAccountIDs,
        brickRoadIndicator: areSettingsInErrorFields(reimbursementOrCollectionAccountIDs, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
        pendingAction: settingsPendingAction(reimbursementOrCollectionAccountIDs, qboConfig?.pendingFields),
    },
    1. The bill payment row configures strictly the reimbursement account (qboConfig?.reimbursementAccountID).
    2. However, subscribing it to [REIMBURSEMENT_ACCOUNT_ID, COLLECTION_ACCOUNT_ID] causes areSettingsInErrorFields to evaluate to true whenever errorFields.collectionAccountID is present, leaking the error to the bill payment row.
    3. Similarly, settingsPendingAction(reimbursementOrCollectionAccountIDs, qboConfig?.pendingFields) causes the bill payment row to prematurely display a pending/saving state whenever the invoice collection account is being saved.

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

    In src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx:

    1. Replace reimbursementOrCollectionAccountIDs with a dedicated reimbursement array reimbursementAccountIDs:
    --- a/src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
    +++ b/src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
    @@ -32,7 +32,7 @@ import React, {useMemo} from 'react';
     import {View} from 'react-native';
     
    -const reimbursementOrCollectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID, CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
    +const reimbursementAccountIDs = [CONST.QUICKBOOKS_CONFIG.REIMBURSEMENT_ACCOUNT_ID];
     const collectionAccountIDs = [CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID];
     const fxExpenseAccounts = [CONST.QUICKBOOKS_CONFIG.FX_EXPENSE_ACCOUNT];
    1. Subscribe the qboBillPaymentAccount row solely to reimbursementAccountIDs:
    @@ -79,9 +79,9 @@ function QuickbooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
                 title: selectedQboAccountName,
                 description: translate('workspace.qbo.advancedConfig.qboBillPaymentAccount', integrationName),
                 onPress: waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_ONLINE_ACCOUNT_SELECTOR.getRoute(policyID))),
    -            subscribedSettings: reimbursementOrCollectionAccountIDs,
    -            brickRoadIndicator: areSettingsInErrorFields(reimbursementOrCollectionAccountIDs, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
    -            pendingAction: settingsPendingAction(reimbursementOrCollectionAccountIDs, qboConfig?.pendingFields),
    +            subscribedSettings: reimbursementAccountIDs,
    +            brickRoadIndicator: areSettingsInErrorFields(reimbursementAccountIDs, qboConfig?.errorFields) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
    +            pendingAction: settingsPendingAction(reimbursementAccountIDs, qboConfig?.pendingFields),
             },

    Automated Unit Tests:

    Add unit tests in tests/unit/pages/workspace/accounting/QuickbooksAdvancedPageTest.tsx:

    • Test 1: When qboConfig.errorFields.collectionAccountID is populated, assert that only the invoice collection account row displays brickRoadIndicator: 'error', while the bill payment row displays no indicator.
    • Test 2: When qboConfig.errorFields.reimbursementAccountID is populated, assert that only the bill payment row displays brickRoadIndicator: 'error'.
    • Test 3: When both fields have errors, assert that both rows independently display their respective indicators.

    What alternative solutions did you explore? (Optional)

    None. Each setting in the QuickBooks advanced accordion represents an independent configuration field with its own selector route. Subscribing each row strictly to its respective setting key matches the established pattern used by collectionAccountIDs and fxExpenseAccounts.

    Contributor details
    Your Expensify account email: bonnhatnguyen0@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182

  11. 22 remaining items

  12. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  14. mallenexpensify commented on Oct 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @parasharrajat due $175 via NewDot

    @parasharrajat plz complete the Contributor+ checklist and tag me in a post once you have. Thx

  15. mallenexpensify commented on Oct 20, 2026

    @mallenexpensify
    Contributor

    @parasharrajat plz complete the Contributor+ checklist and tag me in a post once you have. Thx

  16. melvin-bot commented on Oct 20, 2026

    @melvin-bot

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

  17. parasharrajat commented on Oct 26, 2026

    @parasharrajat
    Member

    BugZero Checklist:

    Regression Test Proposal

    Precondition:

    • Account with QBO connection on Workspace

    Test:

    1. Open Hybrid app
    2. Go to Workspace setting
    3. Go to Accounting > Advance
    4. Turn 'Simulate failing network requests' on
    5. Tap on 'QuickBooks Online invoice collection account'
    6. Select any account in the list.
    7. Verify the RBR should appears on 'QuickBooks Online invoice collection account' row.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-d26d-ab58-c83f-2ec2adc6e164
  18. parasharrajat commented on Oct 26, 2026

    @parasharrajat
    Member
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