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-03-26] [$250] [Simplified Collect][More Features] Optimistically set defaults for Workflows if feature is disabled #38250

Closed
luacmartins opened this issue Mar 13, 2024 · 22 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

@luacmartins
Copy link
Contributor

luacmartins commented Mar 13, 2024

Coming from this PR, we need to optimistically set the default values for the workspace if the workflows feature is disabled, i.e.

  • Scheduled Submit (Delayed Submission) off (harvesting.enabled = false)
  • No approvals (Submit & close) - approval mode OPTIONAL
  • Reimbursement choice - reimburseNo
Issue OwnerCurrent Issue Owner: @bfitzexpensify
@luacmartins luacmartins added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@nkdengineer
Copy link
Contributor

nkdengineer commented Mar 14, 2024

Proposal

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

  • Optimistically set defaults for Workflows if feature is disabled

What is the root cause of that problem?

  • In here, when turning off the policy workflow, we do not has optimistic data for the related keys, for example, approvalMode, areWorkflowsEnabled, autoReporting, harvesting.enabled, reimbursement.choice.reimbursementChoice, ...

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

  • We need to set the above optimistic data once we turn off policy workflow.
 const optimisticDataWhenDisabled = [
        {
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
            value: {
                approvalMode: CONST.POLICY.APPROVAL_MODE.OPTIONAL,
                autoReporting: false,
                harvesting: {
                    enabled: false,
                },
                reimbursement: {choice: {reimbursementChoice: CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO}},
                reimbursementChoice: CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO,
            },
        },
    ];
  • We can add the above optimistic data to the optimisticData in here if enabled: false

  • If the API is called failed, update the failureData as well.

What alternative solutions did you explore? (Optional)

  • NA

@nkdengineer
Copy link
Contributor

@luacmartins Can a contributor work on this issue? I can open the PR in a day. Thanks

@mountiny
Copy link
Contributor

@nkdengineer its a straightforward change, I will export this for $250

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Mar 15, 2024
Copy link

melvin-bot bot commented Mar 15, 2024

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

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

melvin-bot bot commented Mar 15, 2024

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

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

No C+ review will be required

@nkdengineer please raise the Pr

@mountiny mountiny changed the title [Simplified Collect][More Features] Optimistically set defaults for Workflows if feature is disabled [$250] [Simplified Collect][More Features] Optimistically set defaults for Workflows if feature is disabled Mar 15, 2024
Copy link

melvin-bot bot commented Mar 15, 2024

⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

@nkdengineer
Copy link
Contributor

I am working on the PR

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 16, 2024
@nkdengineer
Copy link
Contributor

@luacmartins PR #38432 is ready to review

@mountiny
Copy link
Contributor

PR merged, thanks for a quick work

@bfitzexpensify this will be $250 to @nkdengineer, no C+ this time

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Mar 19, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Mar 19, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Simplified Collect][More Features] Optimistically set defaults for Workflows if feature is disabled [HOLD for payment 2024-03-26] [$250] [Simplified Collect][More Features] Optimistically set defaults for Workflows if feature is disabled Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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

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

  • @nkdengineer requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 19, 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:

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

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@luacmartins
Copy link
Contributor Author

I think we can skip the checklist since this feature was still in development when the bug was repoerted.

@luacmartins
Copy link
Contributor Author

Just pending payment.

@bfitzexpensify
Copy link
Contributor

Sweet - @nkdengineer, can you apply here? https://www.upwork.com/jobs/~0132d6d738f448da5d

@melvin-bot melvin-bot bot removed the Overdue label Apr 1, 2024
@luacmartins luacmartins added Daily KSv2 and removed Weekly KSv2 labels Apr 8, 2024
@mountiny
Copy link
Contributor

mountiny commented Apr 9, 2024

@nkdengineer Is this completed?

@melvin-bot melvin-bot bot added the Overdue label Apr 11, 2024
@bfitzexpensify
Copy link
Contributor

Bump @nkdengineer - can you apply to the Upwork job so we can finalise payment?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Apr 12, 2024
@bfitzexpensify
Copy link
Contributor

Bumping in Slack

@melvin-bot melvin-bot bot removed the Overdue label Apr 15, 2024
@nkdengineer
Copy link
Contributor

Bump @nkdengineer - can you apply to the Upwork job so we can finalise payment?

@bfitzexpensify I applied, thanks a lot!

@bfitzexpensify
Copy link
Contributor

Payment complete, closing this one out.

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
No open projects
Archived in project
Development

No branches or pull requests

5 participants