Skip to content

[Due for payment 2026-01-23] [$250] NetSuite - Enter credentials button is redirecting to the first step of the NetSuite setup #78876

Closed

Description

@vincdargento

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.2.93-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2663/folder/13176904/41237417/1106547125
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: iOS
App Component: Other

Action Performed:

Preconditions:

  1. User is admin of a control Workspace
  2. Enable accounting in workspace settings

Steps:

  1. Go to Workspaces > Accounting
  2. Tap on "Connect" next to "NetSuite"
  3. Reach the token step
  4. Add any info in token fields
  5. Tap on "Confirm"
  6. Tap on the three-dot button
  7. Tap on "Enter your credentials"

Expected Result:

User should be redirected to the token input step.

Actual Result:

User is being redirected to the first step on the NetSuite setup.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022008688791137931719
  • Upwork Job ID: 2008688791137931719
  • Last Price Increase: 2026-01-06
Issue OwnerCurrent Issue Owner: @lydiabarclay

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 5, 2026
  2. melvin-bot commented on Jan 5, 2026

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (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 Jan 5, 2026

    @samranahm
    Contributor

    Proposal

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

    NetSuite "Enter credentials" button redirects to the first step of NetSuite setup instead of the token input step.

    What is the root cause of that problem?

    When the user clicks "Enter your credentials", the system calls startIntegrationFlow({name: CONST.POLICY.CONNECTIONS.NAME.NETSUITE}) which triggers the ConnectToNetSuiteFlow component to render.

    Inside this component, there is a useEffect that correctly checks if there's an authentication error (shouldGoToCredentialsPage) and navigates to the token input page. However, the component also renders a popover menu that shows two options: "Create new connection" (which goes to the first step) and "Reuse existing connection".

    The component doesn't prevent the popover from rendering when there's an authentication error. The popover appears on screen, and when the user interacts with it or the default selection is triggered, it navigates to the first step instead of respecting the token input page navigation that was initiated in the useEffect.

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

    We need to prevent the ConnectToNetSuiteFlow component from rendering the popover menu when there's an authentication error.

    Add a check that returns null before attempting to render the popover menu if shouldGoToCredentialsPage is true:

    // Don't show the popover menu when we need to go to credentials page
    if (shouldGoToCredentialsPage) {
        return null;
    }

    This should be added after the useEffect and before the if (threeDotsMenuContainerRef) check here

    useEffect(() => {
    if (shouldGoToCredentialsPage || !hasPoliciesConnectedToNetSuite) {
    Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT.getRoute(policyID));
    return;
    }
    setIsReuseConnectionsPopoverOpen(true);
    // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
    }, []);

    This ensures that when the user clicks "Enter your credentials", the component will:

    1. Navigate to the token input page (via the existing useEffect)
    2. Not render the popover menu that interfere with that navigation

    What alternative solutions did you explore? (Optional)

    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. MobileMage commented on Jan 5, 2026

    @MobileMage
    Contributor

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

    When a user taps "Enter your credentials" from the three-dot menu after setting up NetSuite, they are redirected to the first step of the NetSuite setup flow instead of directly to the token/credentials input form.

    What is the root cause of that problem?

    The NetSuiteTokenInputPage always starts from step 0, regardless of the navigation context:

    src/pages/workspace/accounting/netsuite/NetSuiteTokenInput/NetSuiteTokenInputPage.tsx:38

    useSubStep<SubStepWithPolicy>({bodyContent: tokenInputSteps, startFrom: 0, onFinished: submit});

    The page has 5 substeps:

    • Steps 0-3: NetSuiteTokenSetupContent (instructional steps)
    • Step 4: NetSuiteTokenInputForm (the actual credentials form)

    When "Enter your credentials" is tapped, the user expects to go directly to step 4 (the credentials form), but the page always starts at step 0.

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

    1. Add a route parameter to specify the starting step

    src/ROUTES.ts - Add optional step parameter:

    POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT: {
    -    route: 'settings/workspaces/:policyID/accounting/netsuite/token-input',
    +    route: 'settings/workspaces/:policyID/accounting/netsuite/token-input/:step?',
    -    getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/netsuite/token-input` as const,
    +    getRoute: (policyID: string, step?: number) =>
    +        `settings/workspaces/${policyID}/accounting/netsuite/token-input${step !== undefined ? `/${step}` : ''}` as const,
    },

    2. Use the step parameter in NetSuiteTokenInputPage

    src/pages/workspace/accounting/netsuite/NetSuiteTokenInput/NetSuiteTokenInputPage.tsx:

    +import {useRoute} from '@react-navigation/native';
    
    function NetSuiteTokenInputPage({policy}: WithPolicyConnectionsProps) {
        const policyID = policy?.id;
        const styles = useThemeStyles();
        const ref: ForwardedRef<InteractiveStepSubHeaderHandle> = useRef(null);
    +   const route = useRoute();
    +   const initialStep = Number(route.params?.step) || 0;
    
        const {
            componentToRender: SubStep,
            isEditing,
            nextScreen,
            prevScreen,
            screenIndex,
            moveTo,
    -   } = useSubStep<SubStepWithPolicy>({bodyContent: tokenInputSteps, startFrom: 0, onFinished: submit});
    +   } = useSubStep<SubStepWithPolicy>({bodyContent: tokenInputSteps, startFrom: initialStep, onFinished: submit});

    3. Navigate directly to credentials step from "Enter your credentials"

    src/components/ConnectToNetSuiteFlow/index.tsx:55-57:

    useEffect(() => {
        if (shouldGoToCredentialsPage || !hasPoliciesConnectedToNetSuite) {
    -       Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT.getRoute(policyID));
    +       // Step 4 is the credentials form (NetSuiteTokenInputForm)
    +       const step = shouldGoToCredentialsPage ? 4 : undefined;
    +       Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT.getRoute(policyID, step));
            return;
        }
        setIsReuseConnectionsPopoverOpen(true);
    }, []);

    This ensures:

    • New connections start from step 0 (full setup flow)
    • Re-entering credentials (auth error) goes directly to step 4 (credentials form)

    What alternative solutions did you explore?

    1. Separate route for credentials-only flow: Considered creating POLICY_ACCOUNTING_NETSUITE_CREDENTIALS route, but this duplicates the page component and is harder to maintain.

    2. Using query params instead of route params: Would work but route params are more consistent with other patterns in the codebase.

  5. Eskalifer1 commented on Jan 5, 2026

    @Eskalifer1
    Contributor

    Proposal

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

    NetSuite - Enter credentials button is redirecting to the first step of the NetSuite setup

    What is the root cause of that problem?

    We navigate here in this useEffect correct:

    useEffect(() => {
    if (shouldGoToCredentialsPage || !hasPoliciesConnectedToNetSuite) {
    Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_TOKEN_INPUT.getRoute(policyID));
    return;
    }
    setIsReuseConnectionsPopoverOpen(true);
    // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
    }, []);

    But we always start flow at 0 step here:

    } = useSubStep<SubStepWithPolicy>({bodyContent: tokenInputSteps, startFrom: 0, onFinished: submit});

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

    We should add check for isAuthenticationError like we did in other page:

    const shouldGoToCredentialsPage = isAuthenticationError(policy, CONST.POLICY.CONNECTIONS.NAME.NETSUITE);
    
    
    startFrom: shouldGoToCredentialsPage ? 4 : 0

    We can also handle case for goBack button if needed

    What alternative solutions did you explore? (Optional)

    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 Jan 6, 2026
  7. melvin-bot commented on Jan 6, 2026

    @melvin-bot
  8. changed the title [-]NetSuite - Enter credentials button is redirecting to the first step of the NetSuite setup[/-] [+][$250] NetSuite - Enter credentials button is redirecting to the first step of the NetSuite setup[/+] on Jan 6, 2026
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 6, 2026
  10. melvin-bot commented on Jan 6, 2026

    @melvin-bot

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

  11. eVoloshchak commented on Jan 8, 2026

    @eVoloshchak
    Contributor

    @samranahm's proposal looks good to me!

    🎀👀🎀 C+ reviewed!

  12. 25 remaining items

  13. Eskalifer1 commented on Jan 26, 2026

    @Eskalifer1
    Contributor

    Hi! I think automation is failed here. PR was deployed 17.01

    cc: @pecanoro @lydiabarclay

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jan 26, 2026
  15. changed the title [-][$250] NetSuite - Enter credentials button is redirecting to the first step of the NetSuite setup[/-] [+][Due for payment 2026-01-23] [$250] NetSuite - Enter credentials button is redirecting to the first step of the NetSuite setup[/+] on Jan 26, 2026
  16. lydiabarclay commented on Jan 26, 2026

    @lydiabarclay
    Contributor

    On it

  17. lydiabarclay commented on Jan 26, 2026

    @lydiabarclay
    Contributor

    Payment Summary

    Contributor: @Eskalifer1 paid $250 via Upwork
    Contributor+: @eVoloshchak due $250 via NewDot

    ✅ Regression test filed

  18. lydiabarclay commented on Jan 26, 2026

    @lydiabarclay
    Contributor

    @eVoloshchak can you please fill out the BZ checklist?

  19. eVoloshchak commented on Jan 27, 2026

    @eVoloshchak
    Contributor

    BugZero Checklist:

    • [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: N/A, this logic was never designed/implemented initially

    • [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: regression wasn't critical

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

    Regression Test Proposal

    Precondition:

    • User is admin of a control Workspace
    • Enable accounting in workspace settings

    Test:

    1. Go to Workspaces > Accounting
    2. Tap on "Connect" next to "NetSuite"
    3. Reach the token step
    4. Add any info in token fields
    5. Tap on "Confirm"
    6. Tap on the three-dot button
    7. Tap on "Enter your credentials"
    8. Ensure user should is redirected to the token input step(step with inputs)

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-15a8-a93e-2933-873e1ef116e4
  20. trjExpensify commented on Jan 31, 2026

    @trjExpensify
    Contributor

    approved $250 for @eVoloshchak.

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 contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions