Skip to content

[Due for payment 2025-05-28] [$250] Accounting - Export to Sage Intacct appears while Sage is in authentication error #59813

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: 9.1.24-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #59718
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 10 / Chrome, Apple iPhone 12 Pro / iOS 18.4
App Component: Other

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Incognito window: Log in with a new Gmail account using Chrome Incognito
  3. Normal window: Log in with the same account using Chrome normal window
  4. Incognito window: Create a workspace
  5. Incognito window: Navigate to Workspace settings - More features
  6. Incognito window: Enable "Accounting"
  7. Incognito window: Navigate to Workspace settings - Accounting
  8. Incognito window: Connect to Sage Intacct with invalid credentials and stop when "Can’t connect to Sage Intacct due to an authentication error." appears
  9. Normal window: Navigate to the workspace chat
  10. Normal window: Create a manual expense with any amount
  11. Normal window: Submit the expense
  12. Normal window: Approve the expense
  13. Normal window: Pay the expense "Elsewhere"

Expected Result:

The button should only appear if a connection is established.

Actual Result:

"Export to Sage Intacct" button appears while Sage Intacct is in authentication error state.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6795789_1744098849264.bandicam_2025-04-08_09-44-21-992.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021909909773376613538
  • Upwork Job ID: 1909909773376613538
  • Last Price Increase: 2025-04-16
  • Automatic offers:
    • mkzie2 | Contributor | 107005426
Issue OwnerCurrent Issue Owner: @allroundexperts

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 8, 2025
  2. melvin-bot commented on Apr 8, 2025

    @melvin-bot

    Triggered auto assignment to @flaviadefaria (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. samranahm commented on Apr 8, 2025

    @samranahm
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-08 13:29:28 UTC.

    Proposal

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

    Accounting - Export to Sage Intacct appears while Sage is in authentication error

    What is the root cause of that problem?

    We are getting the connectedIntegration even if there is connection error

    const connectedIntegration = getConnectedIntegration(policy);

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

    We should add a check here hasAuthenticationError and update shouldShowExportIntegrationButton
    here

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin && canBeExported(iouReport);

    const hasAuthenticationError = connectedIntegration ? policy?.connections?.[connectedIntegration]?.lastSync?.isAuthenticationError : undefined;
    
    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && !hasAuthenticationError && isAdmin && canBeExported(iouReport);

    if there is a connection error then return undefined

    We should do the same on MoneyReportHeader

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

    What alternative solutions did you explore? (Optional)

    we can use this function to get the AuthenticationError and prevent ExportIntegration button on header and report preview.

    function isAuthenticationError(policy: OnyxEntry<Policy>, connectionName: PolicyConnectionName) {

    to get the AuthenticationError then use in shouldShowExportIntegrationButton
    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.

  4. samranahm commented on Apr 8, 2025

    @samranahm
    Contributor

    Proposal updated

    Added alternative solution

  5. mkzie2 commented on Apr 8, 2025

    @mkzie2
    Contributor

    Proposal

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

    "Export to Sage Intacct" button appears while Sage Intacct is in authentication error state.

    What is the root cause of that problem?

    The export button is always shown if the connectedIntegration exists. If we enter invalid credentail, connectedIntegration is not empty but has no data.

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin && canBeExported(iouReport);

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

    This bug is also happening on MoneyReportHeader. I think the best way is we can create a util like getValidConnectedIntegration, this function will return the valid connection (the connection doesn't have authentication error or other conditions that we can ensure is a valid connected integration).

    function getValidConnectedIntegration(policy: Policy | undefined, accountingIntegrations?: ConnectionName[]) {
        return (accountingIntegrations ?? Object.values(CONST.POLICY.CONNECTIONS.NAME)).find((integration) => !!policy?.connections?.[integration] && !isAuthenticationError(policy, integration));
    }
    

    And then we can use it here and here

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    This is a minor UI bug, so I don't think we need to add the test.

    What alternative solutions did you explore? (Optional)

    We can fix this case by case by adding !isAuthenticationError checking to shouldShowExportIntegrationButton

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin && canBeExported(moneyRequestReport);

    const shouldShowExportIntegrationButton = !shouldShowPayButton && !shouldShowSubmitButton && connectedIntegration && isAdmin && canBeExported(iouReport);

    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.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 9, 2025
  7. changed the title [-]Accounting - Export to Sage Intacct appears while Sage is in authentication error[/-] [+][$250] Accounting - Export to Sage Intacct appears while Sage is in authentication error[/+] on Apr 9, 2025
  8. melvin-bot commented on Apr 9, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 9, 2025
  10. melvin-bot commented on Apr 9, 2025

    @melvin-bot

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

  11. flaviadefaria commented on Apr 9, 2025

    @flaviadefaria
    Contributor

    Added the external label.

  12. ishpaul777 commented on Apr 14, 2025

    @ishpaul777
    Contributor

    reviewing tmrw

  13. 32 remaining items

  14. changed the title [-][$250] Accounting - Export to Sage Intacct appears while Sage is in authentication error[/-] [+][Due for payment 2025-05-28] [$250] Accounting - Export to Sage Intacct appears while Sage is in authentication error[/+] on May 21, 2025
  15. melvin-bot commented on May 21, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on May 21, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.47-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-05-28. 🎊

    For reference, here are some details about the assignees on this issue:

  17. melvin-bot commented on May 21, 2025

    @melvin-bot

    @allroundexperts @flaviadefaria @allroundexperts The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  18. flaviadefaria commented on May 28, 2025

    @flaviadefaria
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

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

    • [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
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  19. flaviadefaria commented on May 28, 2025

    @flaviadefaria
    Contributor

    @allroundexperts can you please fill out the checklist above so that I can proceed to payment? Thanks!

  20. flaviadefaria commented on May 29, 2025

    @flaviadefaria
    Contributor

    Friendly bump here @allroundexperts :)

  21. allroundexperts commented on Jun 1, 2025

    @allroundexperts
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:

    Regression Test Proposal

    Precondition:

    • N/A

    Test:

    1. Go to a workspace settings > More features > Enable Accounting
    2. Try to connect to Sage Intacct with an incorrect credential
    3. Verify accounting settings shows "Can't connect to Sage Intacct due to an authentication error."
    4. Go to the workspace chat
    5. Submit and pay an expense elsewhere
    6. Verify Export to Sage Intacct button does not show in the expense preview
    7. Press the expense preview

    Verify Export to Sage Intacct button does not show in the report header

    Do we agree 👍 or 👎

  22. flaviadefaria commented on Jun 2, 2025

    @flaviadefaria
    Contributor

    Payment Summary

    @allroundexperts requires payment through NewDot Manual Requests - $250
    @mkzie2 requires payment automatic offer (Contributor) - $250 (paid)

  23. JmillsExpensify commented on Jun 13, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @allroundexperts

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions