Skip to content

[Due for payment 2025-09-04] [$250] Expensify Card - Smart limit is missing in the list when it is the selected limit type #66844

Closed

Description

@mitarachim

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.1.84-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp https://test-management.browserstack.com/projects/2148171/test-runs/TR-135/folder/12015321/39317903/797466705?sort=%2Bidentifier
Email or phone of affected tester (no customers): applausetester+210703kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Workspace is set up with Expensify card feature.
  1. Go to staging.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click Issue card.
  4. Select user > Next.
  5. Select any card type > Next.
  6. On Limit type page, select Smart limit > Next.
  7. Proceed to limit input page.
  8. Close the RHP.
  9. Go to Workflows.
  10. Disable Add approvals.
  11. Go back to Expensify Card.
  12. Click Issue card.
  13. Continue with the card assignment and complete it.
  14. Click on the assigned card.
  15. Click Limit type.
    → Smart limit is selected but it is missing on the list.

Expected Result:

In Step 15, Smart limit should be present in the list because it is the selected option.

Actual Result:

In Step 15, Smart limit is missing in the list when it is the selected option.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6895022_1753165421894.20250722_141437.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021947709516358065429
  • Upwork Job ID: 1947709516358065429
  • Last Price Increase: 2025-07-22
  • Automatic offers:
    • mkzie2 | Contributor | 108212519
Issue OwnerCurrent Issue Owner: @ahmedGaber93

Activity

  1. added
    Daily
    Bug
    on Jul 22, 2025
  2. melvin-bot commented on Jul 22, 2025

    @melvin-bot

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

  3. mkzie2 commented on Jul 22, 2025

    @mkzie2
    Contributor

    Proposal

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

    In Step 15, Smart limit is missing in the list when it is the selected option.

    What is the root cause of that problem?

    In card limit type editor page, we only show the Smart Limit option if Approvals is enabled in that workspace:

    if (areApprovalsConfigured) {
    options.push({
    value: CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART,

    The problem is you're should not have been able to turn off Approvals when an Expensify card has SmartLimit. But in this case, the user works around by closing the issue new card flow after selecting the limit type, turn off Approvals first then resume the limit value step.

    Image

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

    We have several approaches regarding this:

    1. Show an error and disallow issuing the card in confirmation step if selected SmartLimit but Approvals is disabled
    2. Show the selected limit type as selected with checkmark but disabled (gray-out) in limit type editor page
    3. Clear the issueNewCard Onyx data whenever the issue new card flow RHP is dismissed

    For (1):

    Disable the submit button here when Approvals are disabled and data?.limitType is SmartLimit. And display an explanative error message here if so. It requires the user to update limit type before proceeding.

    const hasApprovalError = !!policy?.errorFields?.approvalMode;
    const isAddApprovalEnabled = [CONST.POLICY.APPROVAL_MODE.BASIC, CONST.POLICY.APPROVAL_MODE.ADVANCED].some((approvalMode) => approvalMode === policy?.approvalMode) && !hasApprovalError;
    const shouldDisableSubmitButton = !isAddApprovalEnabled && data?.limitType === CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART;
    const errorMessage = getLatestErrorMessage(issueNewCard) || (shouldDisableSubmitButton ? translate('workspace.card.issueNewCard.approvalsRequiredError') : '');

    For (2):

    Update this line:

    to:

    if (areApprovalsConfigured || card?.nameValuePairs?.limitType === CONST.EXPENSIFY_CARD.LIMIT_TYPES.SMART) {

    And set the option's isDisabled: !areApprovalsConfigured.

    Same for FIXED option:

    For (3):

    Return a cleanup function the clearIssueNewCardFlow in this effect.

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

    NA

    What alternative solutions did you explore? (Optional)

    NA

    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.

  4. added
    External
    on Jul 22, 2025
  5. melvin-bot commented on Jul 22, 2025

    @melvin-bot
  6. changed the title [-]Expensify Card - Smart limit is missing in the list when it is the selected limit type[/-] [+][$250] Expensify Card - Smart limit is missing in the list when it is the selected limit type[/+] on Jul 22, 2025
  7. added
    Help Wanted
    on Jul 22, 2025
  8. melvin-bot commented on Jul 22, 2025

    @melvin-bot

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

  9. sakluger commented on Jul 25, 2025

    @sakluger
    Contributor

    Hey @ahmedGaber93, could you please review the proposal above?

  10. 62 remaining items

  11. added
    Awaiting Payment
    on Aug 28, 2025
  12. changed the title [-][$250] Expensify Card - Smart limit is missing in the list when it is the selected limit type[/-] [+][Due for payment 2025-09-04] [$250] Expensify Card - Smart limit is missing in the list when it is the selected limit type[/+] on Aug 28, 2025
  13. melvin-bot commented on Aug 28, 2025

    @melvin-bot

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

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

  14. melvin-bot commented on Aug 28, 2025

    @melvin-bot

    @ahmedGaber93 @sakluger 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]

  15. added
    Daily
    and removed
    Weekly
    on Sep 3, 2025
  16. sakluger commented on Sep 4, 2025

    @sakluger
    Contributor

    Hey @ahmedGaber93, could you please complete the BZ checklist for this one?

  17. sakluger commented on Sep 4, 2025

    @sakluger
    Contributor

    Payment Summary

    Contributor: @mkzie2 $250 via Upwork
    Contributor+: @ahmedGaber93 $250 via Newdot: HOLD pending BZ checklist

  18. ahmedGaber93 commented on Sep 6, 2025

    @ahmedGaber93
    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: Applause Internal Team
    • [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/44741/files#r2328022631

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

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

    • Workspace is set up with Expensify card feature.
    • Workspace has Approval workflow enabled

    Test:

    1. Go to workspace settings > Expensify Card > Issue card.
    2. Select user > Next.
    3. Select any card type > Next.
    4. On Limit type page, select Smart limit > Next.
    5. Proceed to limit input page.
    6. Close the RHP.
      • Web: click the backdrop
      • Mobile apps: reopen the app
      • mWeb: navigate directly to the home page via the browser URL
    7. Go to Workflows.
    8. Disable Add approvals.
    9. Go back to Expensify Card.
    10. Proceed to confirmation step
    11. Verify "Issue card" button is disabled and an error shows "'Please enable approvals in Workflows > Add approvals before setting up smart limits" ("Workflows > Add approvals" part is bolded)

    Do we agree 👍 or 👎

  19. ahmedGaber93 commented on Sep 6, 2025

    @ahmedGaber93
    Contributor

    @sakluger Checklist have completed. Sorry for the delay 🙏.

  20. sakluger commented on Sep 8, 2025

    @sakluger
    Contributor

    Thank you! Please use the payment summary above to request payment.

  21. trjExpensify commented on Nov 5, 2025

    @trjExpensify
    Contributor

    approved $250 for @ahmedGaber93.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternalWaiting for copy

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions