Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2024-10-14] [$250] NetSuite - "Can't connect to NetSuite" message appears after connecting #49752

Closed IuliiaHerets closed 1 month ago

IuliiaHerets commented 1 month ago

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.0.40-0 Reproducible in staging?: Y Reproducible in production?: Y Issue was found when executing this PR: https://github.com/Expensify/App/pull/48918 Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with a new Gmail account
  3. Click on FAB - New workspace
  4. Enable "Accounting" in the "More features" page.
  5. Navigate to "Accounting"
  6. Connect to NetSuite and upgrade the workspace to Control when asked
  7. Wait for the sync to finish

Expected Result:

There shouldn't be any error messages.

Actual Result:

"Can't connect to NetSuite" message appears after connecting.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/c94288c5-8c86-4897-b95d-f54c3a588cf8

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021840815188552877987
  • Upwork Job ID: 1840815188552877987
  • Last Price Increase: 2024-09-30
Issue OwnerCurrent Issue Owner: @Ollyws
melvin-bot[bot] commented 1 month ago

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

IuliiaHerets commented 1 month ago

We think that this bug might be related to #wave-control

IuliiaHerets commented 1 month ago

@sonialiap 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

hungvu193 commented 1 month ago

Edited by proposal-police: This proposal was edited at 2024-09-26 02:19:00 UTC.

Proposal

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

NetSuite - "Can't connect to NetSuite" message appears after connecting

What is the root cause of that problem?

In here, we're showing the error if policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]?.verified === false, this logic was added to show the authentication error if the user enters the wrong credentials in this PR (https://github.com/Expensify/App/pull/47059). However, this logic is redundant since we already have a condition to check wrong credentials right before this block here: https://github.com/Expensify/App/blob/3488695033b5903198aeabbb87253c63716de5e8/src/pages/workspace/accounting/utils.tsx#L260

Because of that, when 2 Pusher events arrived later. We will briefly see the error because the connection object contains verified: false and the other contains verified: true.

Screenshot 2024-09-26 at 09 05 48

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

Remove policy?.connections?.[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]?.verified === false from this condition since it's redundant.

After that, we also need to update hasSynchronizationErrorMessage to handle the logic of showing RBR as well.

What alternative solutions did you explore? (Optional)

As I checked, the response of NetSuite connection is almost the same as other connections, we can consider removing this condition and handling Netsuite like other connections. We also need to update hasSynchronizationErrorMessage to handle the logic of showing RBR as well.

layacat commented 1 month ago

How do I get the NetSuite credentials?

sonialiap commented 1 month ago

Checking if we have test credentials

layacat commented 1 month ago

Thank you!

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

mallenexpensify commented 1 month ago

@layacat, for NetSuite, and some other accounting integrations, we currently only allow our expert Contributor+ team to work on them.

@Ollyws , can you review @hungvu193 's proposal above?

Ollyws commented 1 month ago

As I checked, the response of NetSuite connection is almost the same as other connections, we can consider removing this condition and handling Netsuite like other connections.

This was my finding too and it works fine without, what exactly was supposed to be unconventional about the lastSync object for Netsuite?

Let's move forward with @hungvu193's proposal.

๐ŸŽ€๐Ÿ‘€๐ŸŽ€ C+ reviewed

melvin-bot[bot] commented 1 month ago

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

hungvu193 commented 1 month ago

@Ollyws PR is here ๐Ÿ˜„

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

If no regressions arise, payment will be issued on 2024-10-14. :confetti_ball:

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

melvin-bot[bot] commented 1 month ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

sonialiap commented 1 month ago

Payment summary:

Ollyws commented 1 month ago

BugZero Checklist:

  • [x] The PR that introduced the bug has been identified. Link to the PR:

https://github.com/Expensify/App/pull/47059

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

https://github.com/Expensify/App/pull/47059#discussion_r1799884665

  • [x] A discussion in #expensify-bugs 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:

N/A

  • [x] Determine if we should create a regression test for this bug.

Yes.

  • [x] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

1. Login with any account.
2. Create a new WS.
3. Go to that workspace setting => More Features => Enable Accounting feature.
4. Go to Accounting, click NetSuite.
5. Enter NetSuite credentials.
6. Verify you can connect with NetSuite without any issue.

Do we agree ๐Ÿ‘ or ๐Ÿ‘Ž

Ollyws commented 1 month ago

Requested in ND.

melvin-bot[bot] commented 1 month ago

Payment Summary

Upwork Job

BugZero Checklist (@sonialiap)

garrettmknight commented 1 month ago

$250 approved for @Ollyws

garrettmknight commented 1 month ago

$250 approved for @hungvu193