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

[HOLD for payment 2024-10-10] [$250] NetSuite - "Please fix the errors" message persists when navigating back on the RHP #49266

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 16, 2024 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 16, 2024

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.35-0
Reproducible in staging?: Y
Reproducible in production?: Y
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
  8. Navigate to Accounting - Import - Custom Segments/records
  9. Click on the "Add custom segments/record
  10. Choose segment or record and click on the "Next" button
  11. Type in any custom record name and click on the "Next" button
  12. Click on the "Next" button without filling the ID
  13. Click on the "<" button on the RHP
  14. Click on "fix the errors"

Expected Result:

The message should disappear or it should remain and "fix the errors" should redirect me to the RHP step with the error.

Actual Result:

"Please fix the errors" message persists when navigating back on the RHP. The message disappears when I click on "fix the errors". The issue is also present in the "Custom list" flow.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6603604_1726326207704.bandicam_2024-09-14_16-47-55-422.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021837224186168791982
  • Upwork Job ID: 1837224186168791982
  • Last Price Increase: 2024-09-20
  • Automatic offers:
    • cretadn22 | Contributor | 104148130
Issue OwnerCurrent Issue Owner: @slafortune
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

Triggered auto assignment to @slafortune (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
Copy link
Author

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

@IuliiaHerets
Copy link
Author

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

@Krishna2323
Copy link
Contributor

Proposal


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

NetSuite - "Please fix the errors" message persists when navigating back on the RHP

What is the root cause of that problem?

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


  • We should pass a validate function to run the validation function from FormProvider to the parent component through useImperativeHandle.
    useImperativeHandle(forwardedRef, () => ({
        resetForm,
        validate: () => onValidate(inputValues),
    }));
  • In NetSuiteImportAddCustomSegmentPage, we need to run the validation function when the screen index is changed.
    const formRef = useRef<FormRef | null>(null);
    const prevScreenIndex = usePrevious(screenIndex);
    useEffect(() => {
        if (prevScreenIndex <= screenIndex) {
            return;
        }
        formRef.current?.validate();
    }, [screenIndex, prevScreenIndex]);

What alternative solutions did you explore? (Optional)

Result

@cretadn22
Copy link
Contributor

Proposal

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

"Please fix the errors" message persists when navigating back on the RHP

What is the root cause of that problem?

We don't clear errors when navigating back to the previous screen

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

In FormProvider, we'll add a new function called resetError and include it in useImperativeHandle

    const resetError = useCallback(
        () => {
            FormActions.clearErrors(formID);
            FormActions.clearErrorFields(formID);
            setErrors({});
        },
        [formID],
    );
    useImperativeHandle(forwardedRef, () => ({
        resetForm,
        resetError,
    }));

we should invoke the new function when navigating back to the previous screen

    const formRef = useRef<FormRef | null>(null);
    const handleBackButtonPress = () => {
       .....
        ref.current?.movePrevious();
        formRef.current?.resetError();
        prevScreen();
    };

We also need to add formRef to FormProvider

Additionally, we should apply the same change to NetSuiteImportAddCustomListPage, as this bug occurs on that page as well

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

@slafortune Whoops! This issue is 2 days overdue. Let's get this updated quick!

@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label Sep 20, 2024
@melvin-bot melvin-bot bot changed the title NetSuite - "Please fix the errors" message persists when navigating back on the RHP [$250] NetSuite - "Please fix the errors" message persists when navigating back on the RHP Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Sep 20, 2024
Copy link

melvin-bot bot commented Sep 24, 2024

@slafortune, @Pujan92 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Sep 24, 2024
@slafortune
Copy link
Contributor

@Pujan92 are either of the submitted proposals valid?

@Pujan92
Copy link
Contributor

Pujan92 commented Sep 26, 2024

I am more inclined towards resetting the errros on going back instead of validating again the already validated fields. With that, I like the @cretadn22's proposal and we can proceed with it.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 26, 2024

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

@MarioExpensify
Copy link
Contributor

@cretadn22's proposal looks nice, let's move on with this. Thanks @Pujan92

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

melvin-bot bot commented Sep 26, 2024

📣 @cretadn22 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Sep 27, 2024
@melvin-bot melvin-bot bot changed the title [$250] NetSuite - "Please fix the errors" message persists when navigating back on the RHP [HOLD for payment 2024-10-10] [$250] NetSuite - "Please fix the errors" message persists when navigating back on the RHP Oct 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

Copy link

melvin-bot bot commented Oct 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.43-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 2024-10-10. 🎊

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

Copy link

melvin-bot bot commented Oct 3, 2024

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:

  • [@Pujan92] The PR that introduced the bug has been identified. Link to the PR:
  • [@Pujan92] 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:
  • [@Pujan92] 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:
  • [@Pujan92] Determine if we should create a regression test for this bug.
  • [@Pujan92] 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.
  • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

Sorry, something went wrong.

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 9, 2024
@slafortune
Copy link
Contributor

@Pujan92 can you please complete the checklist?

@Pujan92
Copy link
Contributor

Pujan92 commented Oct 10, 2024

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:

Regression Test Steps

  1. Goto any workspace settings and inside More features page to enable Accounting
  2. Navigate to Accounting and connect NetSuite and complete its setup
  3. Once Netsuite setup is completed, Goto Import -> Custom Segments/records
  4. Choose a segment or record and click on the Next button
  5. In this flow steps, try to click on the Next button without providing a field value which will show an error
  6. Go back and verify the errors of the other step isn't persisted

Sorry, something went wrong.

@slafortune
Copy link
Contributor

@Pujan92 Role C+ is owned $250 via NewDot
@cretadn22 Role Contributor was paid $250 via Upworks

@garrettmknight
Copy link
Contributor

$250 approved for @Pujan92

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Archived in project
Development

No branches or pull requests

7 participants