Skip to content

[Due for payment 2026-06-19] [$250] Expensify Card- Restriction field opens blank Set card rule page opens when rules are disabled #92391

Closed

Description

@applause-bot

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.3.91-4
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #92009
Email or phone of affected tester (no customers): #92009
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Log in with Expensifail account.
  • Set up workspace with bank account and enable Expensify Card feature.
  • Enable Rules.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click Issue card.
  4. Select user.
  5. Select Virtual card.
  6. Select limit type and enter amount > Next.
  7. Enable Spend rule, then enter any rule details.
  8. Enable Expiration date, then add dates.
  9. Proceed to confirm page.
  10. On confirm page, click Card type and select Physical card.
  11. Click outside RHP to close the RHp.
  12. Go to workspace settings > More features.
  13. Disable Rules.
  14. Go to workspace settings > Expensify Card.
  15. Click Issue card.
  16. On confirm page, click Restriction.

Expected Result:

When Rules are disabled and physical card is selected, Confirm page will no longer show Restriction field.

Actual Result:

When Rules are disabled and physical card is selected, Confirm page shows Restriction field, which opens blank Set card rules page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7169702_1780413635917.15.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7169702

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. applause-bot commented on Jun 2, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/bb6dd6399a7d179b57d5202b14faa0fe2631077048a04370458e709cbaa795d9

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 2, 2026
  3. melvin-bot commented on Jun 2, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #92009

  4. melvin-bot commented on Jun 2, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 2, 2026

    @github-actions
    Contributor

    👋 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.
  6. JS00001 commented on Jun 2, 2026

    @JS00001
    Contributor

    demoting, locked behind staging

  7. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jun 2, 2026
  8. MelvinBot commented on Jun 2, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The Confirmation step shows the Restriction field based only on the persisted spendRuleEnabled flag — it never checks whether the Rules feature is still enabled on the workspace.

    In ConfirmationStep.tsx:55:

    const isSpendRuleApplied = !!issueNewCard?.data.spendRuleEnabled;

    This flag drives the Restriction menu item at ConfirmationStep.tsx:209-216.

    The repro chain:

    1. Enabling the spend rule writes spendRuleEnabled: true into the RAM-only issue-new-card Onyx data.
    2. Closing the RHP does not clear that data, and re-opening the flow resumes at the persisted CONFIRMATION step.
    3. After Rules is disabled, the Confirmation step still reads spendRuleEnabled === true, so it keeps rendering the Restriction field.
    4. Tapping it navigates to SetSpendRulesStep, which correctly gates all of its content on the Rules feature via isSpendRuleVisible (SetSpendRulesStep.tsx:62) — now false — so only the header renders and the page looks blank.

    So the two pages are inconsistent: SetSpendRulesStep hides the spend‑rule UI when Rules is off, but ConfirmationStep does not.

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

    Gate the Restriction field on the Rules feature using the same check SetSpendRulesStep already uses (isPolicyFeatureEnabled(policy, CONST.POLICY.MORE_FEATURES.ARE_RULES_ENABLED)), so isSpendRuleApplied is only true when both the persisted flag is set and the feature is currently enabled.

    This hides the Restriction field whenever Rules is disabled and makes the blank Set card rules page unreachable from confirm. policy is already available in the component, so no new data is needed.

    What alternative solutions did you explore? (Optional)

    Clearing spendRuleEnabled from the issue-new-card data when the Rules feature is toggled off (or resetting the abandoned flow on re-entry). This addresses the stale-data source directly but is a larger change; the display gate above is the minimal fix and keeps the two pages consistent.

    Confidence & evidence

    Confidence: High — code-only repro, mechanism fully traced, and the fix mirrors an existing pattern in the same flow. Introduced alongside the Confirmation-step Restriction field added in #92009.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/92391) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  9. 40 remaining items

  10. sobitneupane commented on Jun 15, 2026

    @sobitneupane
    Contributor

    @JS00001 Payment for the issue is still pending. #92391 (comment)

  11. sobitneupane commented on Jun 22, 2026

    @sobitneupane
    Contributor

    @JS00001 Payment for the issue is still pending. #92391 (comment)

  12. JS00001 commented on Jun 22, 2026

    @JS00001
    Contributor

    @sobitneupane this was a regression right, not the main tracking issue?

  13. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • 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/2061861361060511942/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. sobitneupane commented on Jun 23, 2026

    @sobitneupane
    Contributor

    his was a regression right, not the main tracking issue?

    @JS00001 It seems like it is. I didn't review the PR assicated with the blocker, though. So, I believe payment is due here.

  16. sobitneupane commented on Jun 23, 2026

    @sobitneupane
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Test:

    1. Create a workspace with expensify cards and rules enabled.
    2. Navigate to Expensify Card Page and complete the Expensify Card Flow adding spend rule (Don't issue card).
    3. Verify that the "Restrictions" menu item is visible in the confirmation page
    4. Disable the rules feature from WS > More Features
    5. Navigate to Expensify Card Page > Issue card
    6. Verify that the restrictions are no longer visible.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-8a1c-ac09-b97f-79e54ac55ae4
  17. JS00001 commented on Jun 23, 2026

    @JS00001
    Contributor

    Right, sounds good!

  18. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  19. mallenexpensify commented on Jun 23, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @sobitneupane due $250 via NewDot

    ^ Test case created. Thx

  20. JmillsExpensify commented on Jul 28, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @sobitneupane

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions