Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Accounting - No warning modal when connecting to NetSuite/Intacct while having existing connection #48269

Closed
6 tasks done
lanitochka17 opened this issue Aug 29, 2024 · 37 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 29, 2024

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: 9.0.26-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Workspace is connected to QBO
  • Workspace is under Collect plan
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Accounting
  3. Click Other integrations
  4. Click Connect next to Xero
  5. Note that it shows warning modal
  6. Close the modal
  7. Click Connect next to NetSuite or Intacct
  8. Click Upgrade
  9. Click Got it, thanks
  10. Note that it proceeds to NetSuite login without the warning modal

Expected Result:

This is how we want the flow to work:

  1. Click Connect alongside NetSuite or Intacct.
  2. Upgrade RHP opens
  3. Click Upgrade
  4. Click Got it, thanks (or <)
  5. RHP closes, centered warning modal appears
  6. Click Connect
  7. Existing integration is disconnected, RHP opens to connect.

Actual Result:

app does not throw warning pop-up when user attempts to connect to NetSuite while connecting to QBO
This issue happens with NetSuite and Sage Intacct which require Control plan

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6585993_1724893015428.20240829_085101.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014b053b91eb324667
  • Upwork Job ID: 1829168357156360660
  • Last Price Increase: 2024-08-29
  • Automatic offers:
    • suneox | Reviewer | 103753753
    • nyomanjyotisa | Contributor | 103753756
Issue OwnerCurrent Issue Owner: @nyomanjyotisa
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

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

@lanitochka17
Copy link
Author

@joekaufmanexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@joekaufmanexpensify
Copy link
Contributor

Reproduced. This only happens when upgrading the workspace. If it's already a control workspace and you try and connect with NetSuite or Intacct, you are warned that the connection will be wiped.

Another issue is that the modal is saying Connect to QuickBooks online when you click to connect to Xero, which seems odd...

@Nodebrute
Copy link
Contributor

@joekaufmanexpensify Here's an open issue for wrong modal name #48265

@joekaufmanexpensify
Copy link
Contributor

Got it. TY!

@joekaufmanexpensify
Copy link
Contributor

Okay, we agreed here that the flow should be try to upgrade to NetSuite/Intacct > warning > upgrade path.

We should fix this for both NetSuite/Intacct here.

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

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

@melvin-bot melvin-bot bot changed the title Accounting - No warning modal when connecting to NetSuite while having existing connection [$250] Accounting - No warning modal when connecting to NetSuite while having existing connection Aug 29, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

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

@joekaufmanexpensify joekaufmanexpensify changed the title [$250] Accounting - No warning modal when connecting to NetSuite while having existing connection [$250] Accounting - No warning modal when connecting to NetSuite/Intacct while having existing connection Aug 29, 2024
@Nodebrute
Copy link
Contributor

Nodebrute commented Aug 29, 2024

Edited by proposal-police: This proposal was edited at 2024-08-29 14:48:06 UTC.

Proposal

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

No warning modal when connecting to NetSuite while having existing connection

What is the root cause of that problem?

Here we are passing backToAfterWorkspaceUpgradeRoute

ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, workspaceUpgradeNavigationDetails.integrationAlias, workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute),

which will be
backToAfterWorkspaceUpgradeRoute: ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_PREREQUISITES.getRoute(policyID),

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

We can remove these upgrade routes from here and here
and here In backTo route we should navigate back to settings accounting page ROUTES.WORKSPACE_ACCOUNTING.getRoute(policyID)

ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, workspaceUpgradeNavigationDetails.integrationAlias, workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute),

What alternative solutions did you explore? (Optional)

@nkdengineer
Copy link
Contributor

nkdengineer commented Aug 29, 2024

Edited by proposal-police: This proposal was edited at 2023-10-04T10:15:00Z.

Proposal

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

In Step 7, app does not throw warning pop-up when user attempts to connect to NetSuite while connecting to QBO
This issue happens with NetSuite and Sage Intacct which require Control plan

What is the root cause of that problem?

When we startIntegrationFlow here for NetSuite/Intacct because these connections require a control policy then we navigate to upgrade page without showing warning modal

const startIntegrationFlow = React.useCallback(
(newActiveIntegration: ActiveIntegration) => {
const accountingIntegrationData = getAccountingIntegrationData(newActiveIntegration.name, policyID, translate);
const workspaceUpgradeNavigationDetails = accountingIntegrationData?.workspaceUpgradeNavigationDetails;
if (workspaceUpgradeNavigationDetails && !isControlPolicy(policy)) {
Navigation.navigate(
ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, workspaceUpgradeNavigationDetails.integrationAlias, workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute),
);
return;
}
setActiveIntegration({
...newActiveIntegration,
key: Math.random(),
});
},
[policy, policyID, translate],
);

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

We can display the warning modal first then if we click on confirm button we will navigate to the upgrade page

To do that we can follow these steps in AccountingContextProvider

  1. Create a ref onModalHideRef to store the callback that we need to do when clicking on confirm button
const onModalHideRef = useRef<(() => void) | undefined>(undefined);
  1. We will assign onModalHideRef as the navigate function here and not return early if newActiveIntegration.integrationToDisconnect is not undefined
if (workspaceUpgradeNavigationDetails && !isControlPolicy(policy)) {
    if (newActiveIntegration?.integrationToDisconnect) {
        onModalHideRef.current = () =>
            Navigation.navigate(
                ROUTES.WORKSPACE_UPGRADE.getRoute(
                    policyID,
                    workspaceUpgradeNavigationDetails.integrationAlias,
                    workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute,
                ),
            );
    } else {
        Navigation.navigate(
            ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, workspaceUpgradeNavigationDetails.integrationAlias, workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute),
        );
        return;
    }
} else {
    onModalHideRef.current = undefined;
}

if (workspaceUpgradeNavigationDetails && !isControlPolicy(policy)) {
Navigation.navigate(
ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, workspaceUpgradeNavigationDetails.integrationAlias, workspaceUpgradeNavigationDetails.backToAfterWorkspaceUpgradeRoute),
);

  1. Call the onModalHideRef callback when we click on confirm button here
onConfirm={() => {
    if (!activeIntegration?.integrationToDisconnect) {
        return;
    }
    removePolicyConnection(policyID, activeIntegration?.integrationToDisconnect);
    closeConfirmationModal();
    onModalHideRef.current?.();
}}

  1. We will also need to reset the onModalHideRef to undefined when we close the confirm modal and after we trigger this callback

What alternative solutions did you explore? (Optional)

Result

Screen.Recording.2024-08-29.at.21.57.16.mov

@nkdengineer
Copy link
Contributor

Updated proposal

  • Update implementation

@nyomanjyotisa
Copy link
Contributor

nyomanjyotisa commented Aug 29, 2024

Edited by proposal-police: This proposal was edited at 2023-10-05T12:01:00Z.

Proposal

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

No warning modal when connecting to NetSuite/Intacct while having existing connection

What is the root cause of that problem?

On click "Got it, thanks" on workspace upgrade navigate directly to POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT due to this code and this

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

  1. we should pass newActiveIntegration.integrationToDisconnect to getAccountingIntegrationData here

then we should navigate to POLICY_ACCOUNTING if there is integration to disconnect
change this and this to the following

backToAfterWorkspaceUpgradeRoute: !!integrationToDisconnect ? ROUTES.POLICY_ACCOUNTING.getRoute(policyID) : ROUTES.POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT.getRoute(policyID),
  1. Once we navigate back to POLICY_ACCOUNTING after the workspace update, it don't automatically display the warning modal. So we can do either of the following to automatically display it after navigate from the workspace upgrade:
  • Pass connectionName, integrationToDisconnect, shouldDisconnectIntegrationBeforeConnecting to POLICY_ACCOUNTING route, then use these values to startIntegrationFlow once the page opened
  • Save connectionName, integrationToDisconnect, shouldDisconnectIntegrationBeforeConnecting on onyx, and do the same

What alternative solutions did you explore? (Optional)

@joekaufmanexpensify
Copy link
Contributor

We revised the plan in Slack. Here's how we want it to work:

  1. Click Connect alongside NetSuite or Intacct.
  2. Upgrade RHP opens
  3. Click Upgrade
  4. Click Got it, thanks (or <)
  5. RHP closes, centered warning modal appears
  6. Click Connect
  7. Existing integration is disconnected, RHP opens to connect.

Updated the OP to reflect this!

@Nodebrute
Copy link
Contributor

@joekaufmanexpensify Could you please review this flow?

Screen.Recording.2024-08-29.at.8.55.09.PM.mov

@nyomanjyotisa
Copy link
Contributor

Proposal updated

@joekaufmanexpensify
Copy link
Contributor

Pending proposal review by @suneox

@suneox
Copy link
Contributor

suneox commented Aug 30, 2024

Thanks for all the proposals. I’ll start the review within a few hours

@suneox
Copy link
Contributor

suneox commented Aug 30, 2024

Based on the latest OP, the RCA from @nyomanjyotisa proposal isn't clearly & solution doesn't match with expected result

Solution from @nkdengineer proposal also doesn't match with expected result

Screen.Recording.2024-08-30.at.22.14.57.mp4

After click on Got it, thanks at step5: RHP closes then centered warning modal appears instead of display the warning modal first

RCA from @nyomanjyotisa proposal is correct & solution add more parameter to handle re-trigger setActiveIntegration flow to show warning modal after navigation back is LGTM, so I think we can go ahead with this proposal

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 30, 2024

Triggered auto assignment to @thienlnam, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 30, 2024
Copy link

melvin-bot bot commented Aug 30, 2024

📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Aug 30, 2024

📣 @nyomanjyotisa 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@joekaufmanexpensify
Copy link
Contributor

@nyomanjyotisa is there an ETA for PR here?

Copy link

melvin-bot bot commented Sep 2, 2024

@suneox, @thienlnam, @joekaufmanexpensify, @nyomanjyotisa Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@joekaufmanexpensify
Copy link
Contributor

PR is WIP. @nyomanjyotisa will this be in review today?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Sep 3, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@eh2077
Copy link
Contributor

eh2077 commented Sep 6, 2024

@suneox Are you available to review this PR #48698 to fix the DB?

@suneox
Copy link
Contributor

suneox commented Sep 6, 2024

@suneox Are you available to review this PR #48698 to fix the DB?

@eh2077 I'll start review now

@joekaufmanexpensify
Copy link
Contributor

PR on staging. It seems like there was a regression too that we had to fix, is that right?

@suneox
Copy link
Contributor

suneox commented Sep 9, 2024

PR on staging. It seems like there was a regression too that we had to fix, is that right?

Yes, the PR for this issue raised regression #48686 & it has been fixed.

@joekaufmanexpensify
Copy link
Contributor

Sweet. TY!

@joekaufmanexpensify
Copy link
Contributor

Looks like automation failed here, and this PR went to prod on 09/09. Payment is due today.

@joekaufmanexpensify
Copy link
Contributor

We need to pay:

  • @nyomanjyotisa - $125 for PR via Upwork (50% reduction for regression).
  • @suneox - $125 for C+ via Upwork (50% reduction for regression).

@joekaufmanexpensify
Copy link
Contributor

All set to pay!

@joekaufmanexpensify
Copy link
Contributor

@nyomanjyotisa $125 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@suneox $125 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job closed.

@joekaufmanexpensify
Copy link
Contributor

All set. TY everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

8 participants