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-11-11] [$250] Approver - Existing approver settings reverts to default after upgrading workspace plan #50924

Closed
8 tasks done
IuliiaHerets opened this issue Oct 16, 2024 · 31 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 Oct 16, 2024

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: 9.0.49-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Workspace is under Collect plan.
  • Workspace has at least two members.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Workflows.
  3. Enable Add approvals.
  4. Click on the existing approval workflow.
  5. Click Approver.
  6. Select another member as approver and save it.
  7. Click Additional approver.
  8. Upgrade the plan.
  9. Click Got it, thanks.

Expected Result:

The existing approver settings in Step 6 will be preserved.

Actual Result:

The existing approver settings in Step 6 reverts to default after upgrading workspace plan.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6636230_1729067871531.20241016_163338.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021847030936559806669
  • Upwork Job ID: 1847030936559806669
  • Last Price Increase: 2024-10-17
  • Automatic offers:
    • ishpaul777 | Reviewer | 104559184
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 16, 2024
Copy link

melvin-bot bot commented Oct 16, 2024

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

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Oct 16, 2024

Edited by proposal-police: This proposal was edited at 2024-10-16 17:02:28 UTC.

Proposal

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

Edit to the approval workflow is reset after upgrading the workspace from the additional approver flow.

What is the root cause of that problem?

When we go back from the upgrade page, we will call dismissModal which will dismiss the whole RHP including the ongoing edit approval flow.

onBackButtonPress={() => {
if (isUpgraded) {
Navigation.dismissModal();
goBack();

Then, we call goBack which navigates to the backTo params, in our case, the edit approval flow.

switch (feature.id) {
case CONST.UPGRADE_FEATURE_INTRO_MAPPING.reportFields.id:
case CONST.UPGRADE_FEATURE_INTRO_MAPPING.rules.id:
case CONST.UPGRADE_FEATURE_INTRO_MAPPING.companyCards.id:
return Navigation.navigate(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(policyID));
default:
return route.params.backTo ? Navigation.navigate(route.params.backTo) : Navigation.goBack();
}

Because the page is closed and then reopened, the flow is restarted.

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

Don't always call dismissModal. For the approval feature, just go back and navigate with the fallback route. For all other existing cases, keep the dismissModal to not change the other existing behavior.

switch (feature.id) {
    case CONST.UPGRADE_FEATURE_INTRO_MAPPING.approvals.id:
        Navigation.goBack();
        if (route.params.backTo) {
            Navigation.navigate(route.params.backTo);
        }
        return;
    case CONST.UPGRADE_FEATURE_INTRO_MAPPING.reportFields.id:
    case CONST.UPGRADE_FEATURE_INTRO_MAPPING.rules.id:
    case CONST.UPGRADE_FEATURE_INTRO_MAPPING.companyCards.id:
        Navigation.dismissModal();
        return Navigation.navigate(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(policyID));
    default:
        Navigation.dismissModal();
        return route.params.backTo ? Navigation.navigate(route.params.backTo) : Navigation.goBack();
}

Then, we can remove the dismissModal from here.

if (isUpgraded) {
Navigation.dismissModal();
goBack();
} else {
Navigation.goBack();
}
}}
/>
{isUpgraded && (
<UpgradeConfirmation
onConfirmUpgrade={() => {
Navigation.dismissModal();
goBack();

@nkdengineer
Copy link
Contributor

Proposal

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

The existing approver settings in Step 6 reverts to default after upgrading workspace plan.

What is the root cause of that problem?

After calling the UpgradeToCorporate function, we have updated the policy type and the Workflow.setApprovalWorkflow function will be called in this useEffect => it has reverted to default approver

Workflow.setApprovalWorkflow({
...currentApprovalWorkflow,
availableMembers: [...currentApprovalWorkflow.members, ...defaultWorkflowMembers],
usedApproverEmails,
action: CONST.APPROVAL_WORKFLOW.ACTION.EDIT,
isLoading: false,
errors: null,
});
setInitialApprovalWorkflow(currentApprovalWorkflow);

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

We will not reset the approval workflow when the policy type changes.

    const policyType = policy?.type;
    const previousType = usePrevious(policy?.type);


   if(policyType !== previousType){
            Workflow.setApprovalWorkflow({
                ...currentApprovalWorkflow,
                availableMembers: [...currentApprovalWorkflow.members, ...defaultWorkflowMembers],
                usedApproverEmails,
                action: CONST.APPROVAL_WORKFLOW.ACTION.EDIT,
                isLoading: false,
                errors: null,
            });
        }

What alternative solutions did you explore? (Optional)

@joekaufmanexpensify
Copy link
Contributor

Reproduced.

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 17, 2024
@melvin-bot melvin-bot bot changed the title Approver - Existing approver settings reverts to default after upgrading workspace plan [$250] Approver - Existing approver settings reverts to default after upgrading workspace plan Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 2024

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

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

melvin-bot bot commented Oct 17, 2024

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

@dylanexpensify dylanexpensify moved this to Release 3: Fall 2024 (Nov) in [#whatsnext] #expense Oct 18, 2024
@dylanexpensify dylanexpensify moved this from Release 3: Fall 2024 (Nov) to Hot Picks in [#whatsnext] #expense Oct 18, 2024
@dylanexpensify dylanexpensify moved this from Hot Picks to Release 3: Fall 2024 (Nov) in [#whatsnext] #expense Oct 18, 2024
@joekaufmanexpensify
Copy link
Contributor

Pending @ishpaul777 review of proposals

@melvin-bot melvin-bot bot added the Overdue label Oct 21, 2024
@ishpaul777
Copy link
Contributor

Thanks for ping, i'll review in couple hours

@melvin-bot melvin-bot bot removed the Overdue label Oct 21, 2024
@joekaufmanexpensify
Copy link
Contributor

Great. TY!

@ishpaul777
Copy link
Contributor

I swear i am on it today 🙇

@ishpaul777
Copy link
Contributor

Proposal from @bernhardoj works well and LGTM!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 22, 2024

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

@MarioExpensify
Copy link
Contributor

Very well, proposal looks good @bernhardoj!! Thank you @ishpaul777, let's move forward.

Copy link

melvin-bot bot commented Oct 23, 2024

📣 @ishpaul777 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@bernhardoj
Copy link
Contributor

PR is ready

cc: @ishpaul777

@joekaufmanexpensify
Copy link
Contributor

PR in review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 4, 2024
@melvin-bot melvin-bot bot changed the title [$250] Approver - Existing approver settings reverts to default after upgrading workspace plan [HOLD for payment 2024-11-11] [$250] Approver - Existing approver settings reverts to default after upgrading workspace plan Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 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 Nov 4, 2024
Copy link

melvin-bot bot commented Nov 4, 2024

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

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

Copy link

melvin-bot bot commented Nov 4, 2024

@ishpaul777 @joekaufmanexpensify 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]

@joekaufmanexpensify
Copy link
Contributor

Payment due next week! @ishpaul777 could you tackle checklist this week?

@joekaufmanexpensify
Copy link
Contributor

Bumped in slack

@ishpaul777
Copy link
Contributor

ishpaul777 commented Nov 11, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [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: https://github.com/Expensify/App/pull/48673/files#r1836862383

  • [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. Not critical, minor issue

    Link to discussion: No need

  • [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.- Not required one time issue now solved.

@joekaufmanexpensify joekaufmanexpensify added Daily KSv2 and removed Weekly KSv2 labels Nov 11, 2024
@joekaufmanexpensify
Copy link
Contributor

Will handle payment today

@joekaufmanexpensify
Copy link
Contributor

Checklist is all set here. We need to pay:

@joekaufmanexpensify
Copy link
Contributor

@ishpaul777 $250 sent and contract ended

@joekaufmanexpensify
Copy link
Contributor

Upwork job closed.

@joekaufmanexpensify
Copy link
Contributor

Closing as all that's left here is for @bernhardoj to request payment via NewDot. Please do this at your earliest convenience!

@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Nov 11, 2024
@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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