App icon indicating copy to clipboard operation
App copied to clipboard

[$250] QBD-Sync status message is not displayed and the last sync time is not updated

Open mitarachim opened this issue 3 months ago • 27 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.2.28-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-1219/folder/13176907/41237422/941906845 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Device used: Windows 11/ Chrome App Component: Workspace Settings

Action Performed:

Precondition: Have a workspace with QBD connected.

  1. Go to staging.new.expensify.com
  2. Log in as workspace admin
  3. Go to workspace settings > Accounting > Export > Export Date > select any option (can be any change in Export or Advanced settings)
  4. Wait until the integration syncs

Expected Result:

The sync status message is displayed, and the last sync time is updated to "Last synced less than a minute ago".

Actual Result:

The sync status message is not displayed, and the last sync time is not updated.

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/a57a04af-da9b-4b29-a9e5-65e067552b04

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022001497172943248753
  • Upwork Job ID: 2001497172943248753
  • Last Price Increase: 2025-12-25
Issue OwnerCurrent Issue Owner: @Krishna2323

mitarachim avatar Oct 09 '25 04:10 mitarachim

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

melvin-bot[bot] avatar Oct 09 '25 04:10 melvin-bot[bot]

@strepanier03 Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] avatar Oct 16 '25 11:10 melvin-bot[bot]

I don't have QBD connected to be able to test this. I'll see if there's any way I can set this up on a mac, but I'm not confident I'll be able to.

strepanier03 avatar Oct 16 '25 17:10 strepanier03

Posted in #bug-zero to see if anyone could help out with testing. If there's no one I'll set to needs repro.

strepanier03 avatar Oct 16 '25 17:10 strepanier03

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

MelvinBot avatar Oct 16 '25 21:10 MelvinBot

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

melvin-bot[bot] avatar Oct 20 '25 11:10 melvin-bot[bot]

Waiting for reproduction.

strepanier03 avatar Oct 22 '25 23:10 strepanier03

@strepanier03 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Oct 28 '25 23:10 melvin-bot[bot]

Reproduction needed still.

strepanier03 avatar Oct 29 '25 00:10 strepanier03

@strepanier03 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 03 '25 23:11 melvin-bot[bot]

This is still waiting for someone to be able to reproduce this. I can't test it and no C+ have posted yet.

strepanier03 avatar Nov 05 '25 01:11 strepanier03

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

MelvinBot avatar Nov 05 '25 01:11 MelvinBot

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

melvin-bot[bot] avatar Nov 12 '25 23:11 melvin-bot[bot]

Not reproducible so far. Setting to weekly until picked up.

strepanier03 avatar Nov 13 '25 01:11 strepanier03

Hello @strepanier03 QA team found similar issue using below steps using latest build v9.2.58-2 in Android and iOS.

Steps : Precondition: User has connected QBO in workspace

  1. Open Expensify app
  2. Tap on "Workspaces" tab and tap on workspace which is connected to QBO
  3. Tap on "Accounting"
  4. Tap on "Import"
  5. Tap on "Locations"
  6. Tap on toggle button to import locations

https://github.com/user-attachments/assets/0ad6f3ae-f0fd-4b91-837c-3193dff947e8

Should we create new issue in this case ? or this is could be same root cause with issue ?

mitarachim avatar Nov 14 '25 06:11 mitarachim

Hmmm, I think we should make a new issue unless it's reproducible on all direct accounting package connections.

strepanier03 avatar Nov 18 '25 03:11 strepanier03

Oops, meant to put this weekly last week.

strepanier03 avatar Nov 25 '25 01:11 strepanier03

I'm going to close this and we can reopen if it becomes reproducible again.

strepanier03 avatar Dec 09 '25 02:12 strepanier03

Re-opening because the issue is still reproducible.

https://github.com/user-attachments/assets/73199fda-b72b-45e0-847b-8dcf7d32c692

nlemma avatar Dec 17 '25 15:12 nlemma

I'm going to set this to weekly since it's still reproducible. I just haven't been able to reproduce it myself, I can't connect to QBD.

strepanier03 avatar Dec 18 '25 03:12 strepanier03

Job added to Upwork: https://www.upwork.com/jobs/~022001497172943248753

melvin-bot[bot] avatar Dec 18 '25 03:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 18 '25 03:12 melvin-bot[bot]

⚠️ This issue has had its price increased by 4x or more. Please review the issue and ensure the price is correct.

melvin-bot[bot] avatar Dec 18 '25 03:12 melvin-bot[bot]

Upwork job price has been updated to $250

melvin-bot[bot] avatar Dec 18 '25 03:12 melvin-bot[bot]

Proposal

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

The QBD sync status message is not displayed and the last sync time is not updated after making changes to Export or Advanced settings in the QuickBooks Desktop integration.

Steps to Reproduce:

  1. Have a workspace with QBD connected
  2. Go to staging.new.expensify.com
  3. Log in as workspace admin
  4. Go to workspace settings > Accounting > Export > Export Date > select any option (or make any change in Export or Advanced settings)
  5. Wait until the integration syncs

Expected Result:

  • The sync status message is displayed during the sync
  • The last sync time is updated to "Last synced less than a minute ago" after successful sync

Actual Result:

  • The sync status message is not displayed
  • The last sync time is not updated

What is the root cause of that problem?

The root cause is that the getAccountingIntegrationData function in utils.tsx is missing the pendingFields and errorFields properties for the QuickBooks Desktop (QBD) integration.

Here's the flow of the issue:

  1. When a user changes an Export or Advanced setting for QBD, the action functions in QuickbooksDesktop.ts (e.g., updateQuickbooksDesktopExportDate) use buildOnyxDataForQuickbooksExportConfiguration to create optimistic Onyx updates that set pendingFields on the config.

  2. The PolicyAccountingPage component uses getAccountingIntegrationData to retrieve integration data, including pendingFields and errorFields, which are then passed to determine:

    • Whether pending actions should be displayed via settingsPendingAction()
    • Whether error indicators should be shown via areSettingsInErrorFields()
  3. The sync status is determined in PolicyAccountingPage.tsx at lines 336-348, where it checks if settings have pending actions and displays the appropriate sync message.

  4. However, the QBD case in getAccountingIntegrationData (lines 276-311) does not return pendingFields and errorFields, unlike all other integrations (QBO, Xero, NetSuite, Sage Intacct).

  5. Without these fields being passed through, the UI cannot detect that settings have pending changes, so:

    • No sync status message is displayed
    • The last sync time doesn't update properly
    • The pending actions and sync progress aren't tracked in the interface

All other accounting integrations correctly include these properties:

  • QBO : pendingFields: {...qboConfig?.pendingFields, ...policy?.connections?.quickbooksOnline?.config?.pendingFields}
  • Xero: pendingFields: policy?.connections?.xero?.config?.pendingFields
  • NetSuite: pendingFields: {...netsuiteConfig?.pendingFields, ...}
  • Sage Intacct: pendingFields: policy?.connections?.intacct?.config?.pendingFields
  • QBD: Missing these properties

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

We should add the missing pendingFields and errorFields properties to the QBD integration data object returned by getAccountingIntegrationData.

Changes needed:

File: utils.tsx

Add the following two lines at the end of the QBD case return statement (after line 309, before the closing }):

pendingFields: policy?.connections?.quickbooksDesktop?.config?.pendingFields,
errorFields: policy?.connections?.quickbooksDesktop?.config?.errorFields,

Complete fix:

case CONST.POLICY.CONNECTIONS.NAME.QBD:
    return {
        title: translate('workspace.accounting.qbd'),
        icon: expensifyIcons?.QBDSquare,
        setupConnectionFlow: (
            <ConnectToQuickbooksDesktopFlow
                policyID={policyID}
                key={key}
            />
        ),
        onImportPagePress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID)),
        onExportPagePress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT.getRoute(policyID)),
        onCardReconciliationPagePress: () => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_CARD_RECONCILIATION.getRoute(policyID, CONST.POLICY.CONNECTIONS.ROUTE.QBD)),
        onAdvancedPagePress: () => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_DESKTOP_ADVANCED.getRoute(policyID)),
        subscribedImportSettings: [
            CONST.QUICKBOOKS_DESKTOP_CONFIG.ENABLE_NEW_CATEGORIES,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CLASSES,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.IMPORT_ITEMS,
        ],
        subscribedExportSettings: [
            CONST.QUICKBOOKS_DESKTOP_CONFIG.EXPORT_DATE,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.EXPORTER,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_ACCOUNT,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.MARK_CHECKS_TO_BE_PRINTED,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.NON_REIMBURSABLE,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.NON_REIMBURSABLE_ACCOUNT,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR,
            CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR,
        ],
        subscribedAdvancedSettings: [CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, CONST.QUICKBOOKS_DESKTOP_CONFIG.AUTO_SYNC],
        workspaceUpgradeNavigationDetails: {
            integrationAlias: CONST.UPGRADE_FEATURE_INTRO_MAPPING.quickbooksDesktop.alias,
            backToAfterWorkspaceUpgradeRoute: getBackToAfterWorkspaceUpgradeRouteForQBD(),
        },
        pendingFields: policy?.connections?.quickbooksDesktop?.config?.pendingFields,
        errorFields: policy?.connections?.quickbooksDesktop?.config?.errorFields,
    };

This change ensures that:

  1. When QBD settings are updated, the pending state is properly tracked through pendingFields
  2. The sync status message is displayed when sync is triggered
  3. The last sync time is updated after successful synchronization
  4. Error states are properly displayed through errorFields
  5. QBD behaves consistently with all other accounting integrations

What alternative solutions did you explore?

None The proposed solution is the simplest, most maintainable fix that aligns QBD with the established patterns used by all other accounting integrations in the codebase.

btkcodedev avatar Dec 18 '25 08:12 btkcodedev

@Krishna2323 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Dec 23 '25 23:12 melvin-bot[bot]

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Dec 25 '25 16:12 melvin-bot[bot]

@Krishna2323 Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] avatar Dec 25 '25 23:12 melvin-bot[bot]

I was not able to reproduce this one, will try again with these steps. Thanks for waiting.

Krishna2323 avatar Dec 26 '25 01:12 Krishna2323

@Krishna2323 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Dec 31 '25 23:12 melvin-bot[bot]