Skip to content

[Due for payment 2025-03-27] Add approvals switch is locked&disabled after reenabling Workflows when Smart limit is selected #57998

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

Closed
8 tasks done
IuliiaHerets opened this issue Mar 7, 2025 · 66 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 Engineering

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Mar 7, 2025

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.1.10-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Workspace has Expensify Card feature.
  • User has assigned a virtual card to themselves (Limit type should not be Smart limit).
  • Add approvals feature is enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click on any card.
  4. Click Limit type.
  5. Select Smart limit and save it.
  6. Go to Workflows.
  7. Note that Add approvals switch is enabled and locked.
  8. Go to More features.
  9. Disable and reenable Workflows.
  10. Go to Workflows.

Expected Result:

Add approvals switch should not be locked.

Actual Result:

Add approvals switch is disabled and locked. User will have to change the Limit type in order to unlock the switch.

In this case, the message asks to change the limit type before "disabling" approvals, when it is already disabled and locked.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6763738_1741336218611.20250307_162316.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @MitchExpensify
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment labels Mar 7, 2025
Copy link

melvin-bot bot commented Mar 7, 2025

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

Copy link

melvin-bot bot commented Mar 7, 2025

Triggered auto assignment to @cristipaval (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Mar 7, 2025

💬 A slack conversation has been started in #expensify-open-source

@melvin-bot melvin-bot bot added the Daily KSv2 label Mar 7, 2025
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Mar 7, 2025
Copy link
Contributor

github-actions bot commented Mar 7, 2025

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@IuliiaHerets
Copy link
Author

Not repro on production

screen-20250307-111250.mp4

@daledah
Copy link
Contributor

daledah commented Mar 7, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-03-07 10:16:52 UTC.

Proposal

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

Add approvals switch is disabled and locked. User will have to change the Limit type in order to unlock the switch.

What is the root cause of that problem?

We don't have any logic to disable workflow button here

{
icon: Illustrations.Workflows,
titleTranslationKey: 'workspace.moreFeatures.workflows.title',
subtitleTranslationKey: 'workspace.moreFeatures.workflows.subtitle',
isActive: policy?.areWorkflowsEnabled ?? false,
pendingAction: policy?.pendingFields?.areWorkflowsEnabled,
action: (isEnabled: boolean) => {
if (!policyID) {
return;
}
enablePolicyWorkflows(policyID, isEnabled);
},
},

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

  1. We should disbale workflow button while we have isSmartLimitEnabled
    const [cardList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}`);
    const workspaceCards = getAllCardsForWorkspace(workspaceAccountID, cardList);
    const isSmartLimitEnabled = isSmartLimitEnabledUtil(workspaceCards);

    ... 

        {
            icon: Illustrations.Workflows,
            disabled: isSmartLimitEnabled,
        },
  1. And we can add disabledAction to show warning modal like we did with others, the modal content will be confirmed later.

const onDisabledOrganizeSwitchPress = useCallback(() => {
if (!hasAccountingConnection) {
return;
}
setIsOrganizeWarningModalOpen(true);
}, [hasAccountingConnection]);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None UI bug

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.

@daledah
Copy link
Contributor

daledah commented Mar 7, 2025

@cristipaval I can quickly raise a PR if needed.

@cristipaval
Copy link
Contributor

@daledah, could you please help me find the offending PR?

@cristipaval
Copy link
Contributor

It looks like this is coming from #57006

@mountiny
Copy link
Contributor

mountiny commented Mar 8, 2025

@nkdengineer You should handle this as a follow up, can you please comment

@mountiny
Copy link
Contributor

mountiny commented Mar 8, 2025

@daledah can you raise a PR for this, we would like to lock the Workflows toggle too when the smartLimit is enabled

@mountiny mountiny assigned daledah and dominictb and unassigned daledah Mar 8, 2025
@mountiny
Copy link
Contributor

mountiny commented Mar 8, 2025

Or actually it should be @nkdengineer with @dominictb handling this

@daledah
Copy link
Contributor

daledah commented Mar 9, 2025

@cristipaval @mountiny i can raise PR now

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Mar 9, 2025
Copy link

melvin-bot bot commented Mar 20, 2025

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

Copy link

melvin-bot bot commented Mar 20, 2025

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

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

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

Copy link

melvin-bot bot commented Mar 20, 2025

@dominictb @MitchExpensify @dominictb 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]

@daledah
Copy link
Contributor

daledah commented Mar 21, 2025

@MitchExpensify @mountiny Looks like this PR is merged and this PR used my proposal here. Should we process the payment as discussion in Slack?

@mountiny
Copy link
Contributor

$50 to @daledah for the proposal

@MitchExpensify
Copy link
Contributor

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 (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. 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:

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

  • [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
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@MitchExpensify
Copy link
Contributor

Payment summary:

  • $250 @nkdengineer requires payment (Needs manual offer from BZ)
  • $250 @dominictb requires payment (Needs manual offer from BZ)
  • $50 @daledah for the proposal

@dominictb can you please complete the BZ steps?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 27, 2025
Copy link

melvin-bot bot commented Mar 27, 2025

Payment Summary

Upwork Job

BugZero Checklist (@MitchExpensify)

  • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@dominictb
Copy link
Contributor

dominictb commented Mar 28, 2025

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: There is new requirement

  • [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: N/A

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

Regression Test Proposal

Test:

  • Precondition:

Workspace has Expensify Card feature.
User has assigned a virtual card to themselves (Limit type should not be Smart limit).
Add approvals feature is enabled.

  1. Go to workspace settings > Expensify Card.
  2. Click on any card.
  3. Click Limit type.
  4. Select Smart limit and save it.
  5. Go to Workflows.
  6. Note that Add approvals switch is enabled and locked.
  7. Go to More features.
  8. Verify that: Workflows switch is locked.
  9. Click that button
  10. Verify that: Not so fast popover is displayed

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Mar 31, 2025
Copy link

melvin-bot bot commented Apr 1, 2025

@MitchExpensify Eep! 4 days overdue now. Issues have feelings too...

@MitchExpensify
Copy link
Contributor

@daledah can you apply to this job as a next step please? https://www.upwork.com/jobs/~021907069798744476418

@melvin-bot melvin-bot bot removed the Overdue label Apr 1, 2025
@daledah
Copy link
Contributor

daledah commented Apr 1, 2025

@daledah can you apply to this job as a next step please? https://www.upwork.com/jobs/~021907069798744476418

When I click the job link, it shows:
Image

@MitchExpensify can you send an offer directly to me https://www.upwork.com/freelancers/~0138d999529f34d33f

Thanks

@melvin-bot melvin-bot bot added the Overdue label Apr 4, 2025
@MitchExpensify
Copy link
Contributor

MitchExpensify commented Apr 6, 2025

New offer sent here @daledah https://www.upwork.com/nx/wm/offer/106810957

@melvin-bot melvin-bot bot removed the Overdue label Apr 6, 2025
@daledah
Copy link
Contributor

daledah commented Apr 7, 2025

@MitchExpensify Accepted thx!

@MitchExpensify
Copy link
Contributor

Paid, thank you!

@nkdengineer
Copy link
Contributor

@MitchExpensify i have not been paid in this issue as this comment. Could you please check again?

@dominictb
Copy link
Contributor

@MitchExpensify I also did not receive payment.

@MitchExpensify
Copy link
Contributor

Oh apologies, I must have got my wires crossed!

Offer sent @nkdengineer: https://www.upwork.com/nx/wm/offer/107183174

What is your Upwork profile @dominictb ?

@nkdengineer
Copy link
Contributor

@MitchExpensify Accepted the offer, thanks for your help!

@dominictb
Copy link
Contributor

What is your Upwork profile @dominictb ?

@MitchExpensify It's https://www.upwork.com/freelancers/~01f70bed1934fd35d5

@MitchExpensify
Copy link
Contributor

Thanks, offer her @dominictb - https://www.upwork.com/nx/wm/offer/107263237

@dominictb
Copy link
Contributor

@MitchExpensify Accepted, thanks 🙏

@MitchExpensify
Copy link
Contributor

Paid, 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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

10 participants