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

[Due for payment 2025-03-05] [$250] Netsuite - App crashes when tapping on export settings after disconnecting with another device #55723

Open
6 of 8 tasks
vincdargento opened this issue Jan 24, 2025 · 16 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@vincdargento
Copy link

vincdargento commented Jan 24, 2025

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.0.89-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
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
Device used: mWeb/Chrome, iphone 13/iOS 18.2.1
App Component: Other

Action Performed:

Prerequisite

  • An account with a workspace connected to NetSuite
  1. Sign in to the account with both web and iOS hybrid app
  2. On iOS app, open Accounting > NetSuite > Export (Stay in this page)
  3. On web navigate to Accounting > NetSuite > Three dot option > Disconnect
  4. On iOS app, tap on preferred exporter

Expected Result:

Not here page is displayed and the app doesn't crash

Actual Result:

App crashes

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

bug.mp4

bug.txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882822298698496668
  • Upwork Job ID: 1882822298698496668
  • Last Price Increase: 2025-01-24
Issue OwnerCurrent Issue Owner: @michaelkwardrop
@vincdargento vincdargento added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

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

@dominictb
Copy link
Contributor

dominictb commented Jan 24, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-01-24 15:53:46 UTC.

Proposal

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

App crashes:

What is the root cause of that problem?

After disconnecting, policy.connections.netsuite is null causing the above error.

const config = policy?.connections?.netsuite.options.config;

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

Add optional chaining ? to netsuite above.

Optionally, we can mark each connection within the Connections type here as optional:

type Connections = {

So we can easily check all the places missing optional chaining like the above.

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

N/A

@michaelkwardrop michaelkwardrop added the External Added to denote the issue can be worked on by a contributor label Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

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

@melvin-bot melvin-bot bot changed the title Netsuite - App crashes when tapping on export settings after disconnecting with another device [$250] Netsuite - App crashes when tapping on export settings after disconnecting with another device Jan 24, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

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

@hoangzinh
Copy link
Contributor

Proposal

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

After disconnecting with another device:

  • App crashes when tapping on export settings
  • App doesn't show "Not here" page in the export settings page

What is the root cause of that problem?

Based on expected behavior, there are 2 issues here:
1. App crashes when tapping on export settings:
Image

According the log, it has error in this line

const config = policy?.connections?.netsuite.options.config;

Because when we disconnect Netsuite in 2nd device, policy?.connections?.netsuite will be undefined, therefore it causes "cannot read properties" error

2. App doesn't show "Not here" page in the export settings page
When user in the Export settings page in the 1st device, then disconnect Netsuite in 2nd device, it should show "Not here" page to prevent the user continue access Netsuite setting pages. But it still shows Export settings page.

The reason is in NetSuiteExportConfigurationPage component, we use ConnectionLayout to handle policy connect, and it will show "Not here" page if the connection is null

const isConnectionEmpty = isEmpty(policy?.connections?.[connectionName]);

However, we don't subscribe to Onyx of policy, but we get the policy in memory here

const policy = PolicyUtils.getPolicy(policyID);

Therefore, even when the Netsuite connect is cleared in Onyx, it still shows Export page normally

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

1. App crashes when tapping on export settings:
To solve this issue, we should use optional chaining for netsuite?.options here:

const config = policy?.connections?.netsuite.options.config;

We should fix it for other pages as well

2. App doesn't show "Not here" page in the export settings page
In ConnectionLayout component (and SelectionScreen component), we should replace this line by getting policy from Onyx like this

const [policy, policyResults] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);

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)

@ahmedGaber93
Copy link
Contributor

Thanks all for the proposals.

Expected result:

Not here page is displayed and the app doesn't crash

@dominictb your proposal can fix the crash, but you missed fixing "Not here page is not displayed".

@hoangzinh your proposal cover the two issues and it should fix them. But after going back from "Not here page", the "Acounting" page re-display the "NetSuite" as a connected. Could you please check it?

20250126165838387.mp4

@hoangzinh
Copy link
Contributor

@ahmedGaber93 could you test that issue again? I'm unable to reproduce it. I guess the remove connection failed or was unsuccessful.

Screen.Recording.2025-01-27.at.22.22.38.mov

@ahmedGaber93
Copy link
Contributor

could you test that issue again? I'm unable to reproduce it. I guess the remove connection failed or was unsuccessful.

Hmm! I am also not able to reproduce, let's move forward and retest it on the PR.

20250127204437078.mp4

@ahmedGaber93
Copy link
Contributor

@hoangzinh's proposal LGTM!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 27, 2025

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

@dangrous
Copy link
Contributor

Looks good to me too!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 28, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 30, 2025
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Feb 24, 2025
Copy link

melvin-bot bot commented Feb 24, 2025

This issue has not been updated in over 15 days. @dangrous, @hoangzinh, @ahmedGaber93, @michaelkwardrop eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@ahmedGaber93
Copy link
Contributor

@dangrous bump #56021 (comment)

@melvin-bot melvin-bot bot removed the Monthly KSv2 label Feb 26, 2025
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Feb 26, 2025
@melvin-bot melvin-bot bot changed the title [$250] Netsuite - App crashes when tapping on export settings after disconnecting with another device [Due for payment 2025-03-05] [$250] Netsuite - App crashes when tapping on export settings after disconnecting with another device Feb 26, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 26, 2025
Copy link

melvin-bot bot commented Feb 26, 2025

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

Copy link

melvin-bot bot commented Feb 26, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.6-1 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-03-05. 🎊

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

  • @hoangzinh requires payment through NewDot Manual Requests
  • @ahmedGaber93 requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Feb 26, 2025

@hoangzinh / @ahmedGaber93 @michaelkwardrop @hoangzinh / @ahmedGaber93 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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants