Skip to content

[Due for payment 2026-11-10] [$250] NewDot hides the NetSuite subsidiary selector when the connection has a sync error #105308

Closed

Description

@yuwenmemon

Problem

When a workspace's NetSuite connection has a sync/connection error, NewDot (Workspace > Accounting) does not show the Subsidiary selector. The admin can't switch subsidiaries from NewDot, even when the wrong subsidiary is the reason the sync is failing.

OldDot still shows the subsidiary selector alongside the sync error, so admins can fix it there. Support confirmed that switching the subsidiary in OldDot resolved the issue for a customer. So this isn't urgent, but NewDot should match OldDot.

Likely cause

In useConnectedAccountingIntegration.tsx (permalink), the integration-specific row (which holds the NetSuite subsidiary selector) is dropped whenever a sync error exists:

const settingsMenuItems: MenuItemData[] = [
    ...(isEmptyObject(integrationSpecificMenuItems) || shouldShowSynchronizationError || !hasAccountingConnection ? [] : [integrationSpecificMenuItems]),
    ...(!hasAccountingConnection || !isConnectionVerified ? [] : configurationOptions),
];

shouldShowSynchronizationError is !!synchronizationError, so any sync error hides the selector. This logic is shared, so the same likely applies to the Xero organization, Sage Intacct entity, Rillet/Campfire/DualEntry/Business Central selectors, and so on.

Expected

Show the subsidiary selector even when the connection has a sync error, at least for errors that aren't authentication errors, matching OldDot. Confirm the intended behavior with @trjExpensify.

cc @mananjadhav, you added the NetSuite subsidiary selector in #44038, where it was hidden on sync errors from the start.

Internal issue: https://github.com/Expensify/Expensify/issues/696960

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

Activity

  1. trjExpensify commented on Oct 29, 2026

    @trjExpensify
    Contributor

    Show the subsidiary selector even when the connection has a sync error, at least for errors that aren't authentication errors

    Makes sense to me. 👍

  2. added
    Improvement
    Help Wanted
    and removed on Oct 29, 2026
  3. wildan-m commented on Oct 29, 2026

    @wildan-m
    Contributor

    Proposal

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

    When a workspace's NetSuite connection has a sync error, Workspace > Accounting in NewDot hides the Subsidiary selector, so the admin cannot switch subsidiaries even when the wrong subsidiary is the cause of the failing sync. OldDot keeps the selector visible next to the error.

    What is the root cause of that problem?

    In useConnectedAccountingIntegration, the integration-specific row (NetSuite subsidiary, Xero organization, Sage Intacct entity, QBO/IES entity, Certinia company, Rillet/Campfire/DualEntry/Business Central/Zoho Books selectors) is dropped from settingsMenuItems whenever shouldShowSynchronizationError is true:

    const settingsMenuItems: MenuItemData[] = [
    ...(isEmptyObject(integrationSpecificMenuItems) || shouldShowSynchronizationError || !hasAccountingConnection ? [] : [integrationSpecificMenuItems]),
    ...(!hasAccountingConnection || !isConnectionVerified ? [] : configurationOptions),
    ];

    shouldShowSynchronizationError is just !!synchronizationError, so it is true for every failed sync, not only for authentication failures:

    const shouldShowSynchronizationError = !!synchronizationError;

    getSynchronizationErrorMessage returns a message for both cases: the authentication error, and the generic "couldn't sync" error built from lastSync.errorMessage whenever lastSync.isSuccessful === false:

    if (isAuthenticationError(policy, connectionName)) {
    return (
    <Text style={[styles?.formError]}>
    <Text style={[styles?.formError]}>{translate('workspace.common.authenticationError', connectionDisplayName)} </Text>
    {connectionName in CONST.POLICY.CONNECTIONS.AUTH_HELP_LINKS && (
    <>
    <TextLink
    style={[styles?.link, styles?.fontSizeLabel]}
    href={CONST.POLICY.CONNECTIONS.AUTH_HELP_LINKS[connectionName as keyof typeof CONST.POLICY.CONNECTIONS.AUTH_HELP_LINKS]}
    >
    {translate('workspace.common.learnMore')}
    </TextLink>
    .
    </>
    )}
    </Text>
    );
    }
    const syncError = translate('workspace.accounting.syncError', connectionDisplayName);
    const connection = policy?.connections?.[connectionName];
    if (isSyncInProgress || isEmptyObject(connection?.lastSync) || connection?.lastSync?.isSuccessful !== false || !connection?.lastSync?.errorDate) {
    return;
    }
    return `${syncError} ("${connection?.lastSync?.errorMessage}")`;

    So a plain sync failure (for example, one caused by picking the wrong subsidiary) removes the very control the admin needs to fix it. The rule is also inconsistent within the same list: the Import, Export and Advanced rows right below it are gated only on hasAccountingConnection and isConnectionVerified and stay visible during the same sync error. The selector page itself (NetSuiteSubsidiarySelector) has no sync-error guard, so only this menu row condition blocks the flow.

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

    In getConnectionDetails inside useConnectedAccountingIntegration, stop hiding the integration-specific row for every sync error. Replace shouldShowSynchronizationError in that condition with the existing hasAuthError flag, which is already computed in the hook and is true only when the error is an authentication error:

    const hasAuthError = !!connectedIntegration && !!synchronizationError && isAuthenticationError(policy, connectedIntegration);

    Current main has since added a Zoho Books-only exception to this condition (shouldKeepIntegrationSpecificMenuItemOnSyncError), which keeps only the Zoho Books organization row through a sync error; every other connector, NetSuite included, still loses its row:

    ...(isEmptyObject(integrationSpecificMenuItems) || (shouldShowSynchronizationError && !shouldKeepIntegrationSpecificMenuItemOnSyncError) || !hasAccountingConnection
    ? []
    : [integrationSpecificMenuItems]),

    So the change is hasAuthError && !<Zoho Books flag> in place of shouldShowSynchronizationError && !<Zoho Books flag>. The Zoho Books flag stays (renamed to shouldKeepIntegrationSpecificMenuItemOnAuthError, since it now only matters for authentication errors), so Zoho Books behavior is unchanged.

    With that change:

    • Non-authentication sync errors keep the subsidiary/entity/organization selector visible next to the error text, matching OldDot, so the admin can switch the subsidiary and re-sync.
    • Authentication errors still hide the selector (the credentials are invalid, so changing the subsidiary cannot help, and the "Enter credentials" / "Reconnect" action stays the path forward).

    Because the condition is shared, this applies to every integration that renders a selector row (Xero, Sage Intacct, Rillet, Campfire, DualEntry, Business Central, and so on), which keeps their behavior consistent. If the team prefers to show the selector even on authentication errors, the condition can drop the error check entirely; that is a one-flag decision to confirm with the issue owner.

    No other changes are needed: the row's own pendingAction / brickRoadIndicator handling and the selector pages already work while a sync error is present. The existing useConnectedAccountingIntegrationTest case that asserted the Campfire entity row is dropped on any failed sync is updated to the new rule, and new cases cover NetSuite: a failed non-auth sync keeps the subsidiary row in settingsMenuItems, and an authentication error removes it. The two "keep" cases fail on current main and pass with the change.

    Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/105308-keep-subsidiary-row-on-sync-error?expand=1

    What alternative solutions did you explore? (Optional)

    Scope the change to NetSuite only, by adding NetSuite next to Zoho Books in the existing keep-on-error flag. This fixes the reported case but leaves the same dead-end for Xero organizations, Sage Intacct entities and the other subsidiary-style selectors that share this condition, so the generic change above is preferable.

  4. changed the title [-]NewDot hides the NetSuite subsidiary selector when the connection has a sync error[/-] [+][$250] NewDot hides the NetSuite subsidiary selector when the connection has a sync error[/+] on Oct 29, 2026
  5. removed
    Help Wanted
    on Oct 29, 2026
  6. melvin-bot commented on Oct 29, 2026

    @melvin-bot
  7. Dip-G-Git commented on Oct 29, 2026

    @Dip-G-Git

    🚨 Edited by proposal-police: This proposal was edited at 2026-10-29 18:40:16 UTC.

    Proposal

    What is the root cause of that problem?

    • Primary Root Cause: src/pages/workspace/accounting/useConnectedAccountingIntegration.tsx:566-569 — the integration-specific row (NetSuite subsidiary, Xero org, Intacct entity, etc.) is dropped from settingsMenuItems whenever shouldShowSynchronizationError is true, unless the connection is Zoho Books:
    const settingsMenuItems: MenuItemData[] = [
        ...(isEmptyObject(integrationSpecificMenuItems) || (shouldShowSynchronizationError && !shouldKeepIntegrationSpecificMenuItemOnSyncError) || !hasAccountingConnection
            ? []
            : [integrationSpecificMenuItems]),
        ...(!hasAccountingConnection || !isConnectionVerified ? [] : configurationOptions),
    ];

    The gate is shouldShowSynchronizationError, which is far too broad.

    • Secondary Root Cause: src/pages/workspace/accounting/useConnectedAccountingIntegration.tsx:182 — shouldShowSynchronizationError is just a truthiness check over any error message:
    const shouldShowSynchronizationError = !!synchronizationError;

    synchronizationError comes from getSynchronizationErrorMessage (src/pages/workspace/accounting/utils.tsx:784-810), which returns a message both for auth errors and for a plain failed sync (lastSync.isSuccessful === false with an errorDate). So a non-auth sync failure — e.g. the wrong subsidiary is selected — flips shouldShowSynchronizationError to true and removes the very row the admin needs.

    • Affected Files: src/pages/workspace/accounting/useConnectedAccountingIntegration.tsx (L161 hasAuthError, L182 shouldShowSynchronizationError, L531 shouldKeepIntegrationSpecificMenuItemOnSyncError, L566-569 the gate).
    • Affected Component(s): useConnectedAccountingIntegration hook → Workspace > Accounting page and the Connections accounting panel.
    • Bug Category: Wrong condition / over-broad guard (model-vs-reality divergence: "has any error" conflated with "has auth error").
    • Mechanism: Admin opens Workspace > Accounting (L566 gate reached) → connection last sync failed for a non-auth reason, so getSynchronizationErrorMessage returns a message (utils.tsx:808) → synchronizationError is truthy (L181) → shouldShowSynchronizationError = true (L182) → shouldKeepIntegrationSpecificMenuItemOnSyncError is false for NetSuite (L531, only true for Zoho) → the spread evaluates to [] (L567) → the subsidiary row is omitted from settingsMenuItems → selector never renders. Meanwhile the Import/Export/Advanced rows below (L568) are gated only on hasAccountingConnection/isConnectionVerified and stay visible, which is the inconsistency OldDot doesn't have.

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

    • Fix Option 1 (Recommended): src/pages/workspace/accounting/useConnectedAccountingIntegration.tsx:566-569 — swap the over-broad shouldShowSynchronizationError guard for the already-computed hasAuthError (defined at L161 as !!connectedIntegration && !!synchronizationError && isAuthenticationError(...)). The existing Zoho carve-out becomes redundant and can be removed.

      Before (conceptually):
      isEmptyObject(...) || (shouldShowSynchronizationError && !shouldKeepIntegrationSpecificMenuItemOnSyncError) || !hasAccountingConnection

      After:
      isEmptyObject(...) || hasAuthError || !hasAccountingConnection

      Why best: it fixes the truth at the source — only authentication failures hide the selector (changing the subsidiary can't help if credentials are invalid), while every other sync error keeps it visible next to the error text, matching OldDot. Because the gate is shared, it fixes NetSuite, Xero, Intacct, Rillet, Campfire, DualEntry, Business Central and QBO/IES at once, and it keeps Zoho's existing "always show" behavior (Zoho has no auth-error path here), so shouldKeepIntegrationSpecificMenuItemOnSyncError can be deleted.

    • Fix Option 2 (Alternative): Keep shouldShowSynchronizationError but AND it with hasAuthError only: (shouldShowSynchronizationError && hasAuthError && !shouldKeepIntegrationSpecificMenuItemOnSyncError). Trade-off: functionally equal but keeps the now-redundant Zoho flag and the broad name, so it's noisier and leaves dead logic behind.

    • Revert Option: Revert the subsidiary-selector gate introduced in PR [#Wave-Control: Add NetSuite]: Top-level Subsidiary selection #44038. Not ideal — it would remove the selector entirely rather than just un-hiding it on sync errors, and it predates the Zoho/other integrations now relying on this code path.

    • Alternate fix (rejected): Scope the change to NetSuite only (connectedIntegration === NETSUITE). Rejected — it leaves the identical dead-end for Xero org / Intacct entity / the other subsidiary-style selectors that share this exact condition.

    Fix Description Files to Change Effort Risk Status
    1 Replace shouldShowSynchronizationError gate with hasAuthError; drop redundant Zoho flag useConnectedAccountingIntegration.tsx Low Low Recommended
    2 AND the existing gate with hasAuthError useConnectedAccountingIntegration.tsx Low Low Alternative
    3 Revert PR #44038 selector gate useConnectedAccountingIntegration.tsx Med Med Rejected

    What alternative solutions did you explore? (Optional)

    • Add only the m flag — matches the line but still erases the title (rejected above).
    • Move the subtitle to its own label on the server — leaves old charts broken and keeps the App brittle.
    • Revert the localizer — restores the original wrong behavior.

    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.

  8. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    🤖 ProposalPolice™ is tracking duplicate proposals for this issue using an OpenAI Conversation. This comment stores that Conversation's ID and can be safely ignored.

  9. added
    Help Wanted
    on Oct 29, 2026
  10. 53 remaining items

  11. mananjadhav commented on Nov 9, 2026

    @mananjadhav
    Collaborator

    @mallenexpensify The checklist is complete.

  12. added
    Weekly
    Daily
    Awaiting Payment
    and removed
    Weekly
    on Nov 9, 2026
  13. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    Upwork Job

    • Reviewer: @mananjadhav owed $250 via NewDot
    • Assignee: @wildan-m requires payment (Needs manual offer from BZ)

    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
  15. mananjadhav commented on Nov 12, 2026

    @mananjadhav
    Collaborator

    Waiting for the payout. @mallenexpensify

  16. melvin-bot commented on Nov 12, 2026

    @melvin-bot

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

  17. mallenexpensify commented on Nov 13, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @wildan-m paid $250 via Upwork
    Contributor+: @mananjadhav due $250 via NewDot

  18. garrettmknight commented on Nov 23, 2026

    @garrettmknight
    Contributor

    $250 approved for @mananjadhav

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

Metadata

Metadata

Labels

Awaiting PaymentDailyEngineeringExternalImprovement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions