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-06-20] [HOLD for payment 2024-06-18] [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes #42356

Closed
yuwenmemon opened this issue May 17, 2024 · 23 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item.

Comments

@yuwenmemon
Copy link
Contributor

yuwenmemon commented May 17, 2024

Part of the #Wave-Control NetSuite project

Main issue: https://github.com/Expensify/Expensify/issues/377671
Doc section: https://docs.google.com/document/d/1WubNv_VAv78IxG4FKsi9aS0pWESfWvUYbqBAAy5b4bc/edit#heading=h.tb9yro1dmj3r
Project: https://github.com/orgs/Expensify/projects/130

Feature Description

One issue with the Pusher ProgressManager updates for syncs that come from the IS to NewDot is that they are sometimes unreliable. If the jobDone sync update is not received by the client, then the sync spinner will hang forever, even though the sync has finished:

Kapture.2024-05-17.at.15.00.36.mp4

To fix this, let's have the spinner timeout to stop 20 min after a sync is started and no jobDone sync update is received. We landed one 20 minutes because, in recent measurements, our longest NetSuite jobs take around 14 minutes.

Manual Test Steps

  1. Initiate a QBO sync from your workspace that's connected to QBO
  2. Go offline
  3. Wait for 10 min
  4. Go back online
  5. Make sure that after 10 more minutes, the spinner has stopped.

Automated Tests

N/A

cc @aldo-expensify @francoisl @lakchote @marcaaron @tgolen

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c42a63242268a2f0
  • Upwork Job ID: 1792660966817673216
  • Last Price Increase: 2024-05-29
Issue OwnerCurrent Issue Owner: @twisterdotcom
@yuwenmemon yuwenmemon added the Bug Something is broken. Auto assigns a BugZero manager. label May 17, 2024
@yuwenmemon yuwenmemon self-assigned this May 17, 2024
@yuwenmemon yuwenmemon changed the title Have Accounting Connection Sync Spinner Timeout After 20 minutes. Have Accounting Connection Sync Spinner Timeout After 20 minutes May 17, 2024
Copy link

melvin-bot bot commented May 17, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label May 17, 2024
@yuwenmemon yuwenmemon changed the title Have Accounting Connection Sync Spinner Timeout After 20 minutes [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes May 17, 2024
@JmillsExpensify JmillsExpensify moved this to Release 2: Summer 2024 (Aug) in [#whatsnext] #expense May 17, 2024
@melvin-bot melvin-bot bot added the Overdue label May 20, 2024
@twisterdotcom
Copy link
Contributor

I think this is New Feature, not Bug right?

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@twisterdotcom twisterdotcom added NewFeature Something to build that is a new item. Overdue and removed Bug Something is broken. Auto assigns a BugZero manager. labels May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

Current assignee @twisterdotcom is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels May 20, 2024
@twisterdotcom twisterdotcom added Daily KSv2 and removed Weekly KSv2 Overdue labels May 20, 2024
@yuwenmemon
Copy link
Contributor Author

Yeah that seems like a fair characterization as well.

@yuwenmemon yuwenmemon added the External Added to denote the issue can be worked on by a contributor label May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

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

@melvin-bot melvin-bot bot changed the title [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes May 20, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 20, 2024
Copy link

melvin-bot bot commented May 20, 2024

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

@nkdengineer
Copy link
Contributor

Proposal

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

Spinner hasn't stopped even though the sync has finished

What is the root cause of that problem?

This is a new feature

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

  1. In QuickBooksOnline, create a function like syncConnectionAfterTimeout that will update stageInProgress to jobDone
function syncConnectionAfterTimeout(policyID: string) {
    Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS}${policyID}`,  {
        stageInProgress: CONST.POLICY.CONNECTIONS.SYNC_STAGE_NAME.JOB_DONE,
        connectionName: CONST.POLICY.CONNECTIONS.NAME.QBO,
    })
}
  1. In PolicyAccountingPage, we will create a useEffect that will be triggered when connectionSyncProgress?.stageInProgress is changed and in this we will have a setTimeout 20 minutes to update connectionSyncProgress?.stageInProgress to jobDone so if a sync is started and no jobDone sync update is received
useEffect(() => {
    if (!connectionSyncProgress?.stageInProgress || connectionSyncProgress?.stageInProgress === CONST.POLICY.CONNECTIONS.SYNC_STAGE_NAME.JOB_DONE) {
        return;
    }
    spinnerTimeoutRef.current = setTimeout(() => {
        syncConnectionAfterTimeout(policy.id);
    }, 20*60*1000);

    return () => {
        if (!spinnerTimeoutRef.current) {
            return;
        }

        clearTimeout(spinnerTimeoutRef.current)
    }
}, [connectionSyncProgress?.stageInProgress])

What alternative solutions did you explore? (Optional)

We can create a state to control whenever we should show spinner and then update it in the setTimeout of point 2

@aldo-expensify
Copy link
Contributor

@yuwenmemon for this, instead of adding a setTimeout in the front end, I think it can be more reliably implemented like:

  1. The IS server should include a timestamp in the progress data (PolicyConnectionSyncProgress)
  2. isSyncInProgress should ignore the progress data if it is older than 20 minutes

What do you think?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 23, 2024
@yuwenmemon yuwenmemon removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 23, 2024
@twisterdotcom twisterdotcom changed the title [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes May 29, 2024
@twisterdotcom
Copy link
Contributor

Removed the /app job and automation hopefully.

@twisterdotcom
Copy link
Contributor

Ah crap, wait I see @ahmedGaber93 reviewed #42498. Damn, thought that was an internal PR. Okay, will pay that out when it's due.

@twisterdotcom twisterdotcom changed the title [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes May 29, 2024
Copy link

melvin-bot bot commented May 29, 2024

Upwork job price has been updated to $250

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 11, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes [HOLD for payment 2024-06-18] [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes Jun 11, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

Copy link

melvin-bot bot commented Jun 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 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-06-18. 🎊

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

Copy link

melvin-bot bot commented Jun 11, 2024

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

  • [@ahmedGaber93] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-18] [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] [Wave Control - NetSuite] Have Accounting Connection Sync Spinner Timeout After 20 minutes Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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-06-20. 🎊

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

Copy link

melvin-bot bot commented Jun 13, 2024

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

  • [@ahmedGaber93] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 18, 2024
@twisterdotcom
Copy link
Contributor

twisterdotcom commented Jun 20, 2024

Payment Summary:

NewFeature, not sure we need a regression test right?

@github-project-automation github-project-automation bot moved this from Release 2: Summer 2024 (Aug) to Done in [#whatsnext] #expense Jun 20, 2024
@ahmedGaber93
Copy link
Contributor

@twisterdotcom offer accepted, please please complete the payment when you are available. Thanks!

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 Daily KSv2 Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item.
Projects
Status: Done
Development

No branches or pull requests

6 participants