Skip to content

[Due for payment 2026-08-17] Rules - "Please select at least one field" is shown when all fields are selected #97560

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.47-0
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: #96591
Email or phone of affected tester (no customers): applausetester+ssndjois2jd1@applause.expensifail.com
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.
  • Enable Rules.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Open any category.
  4. Click Create new rule > Field requirements.
  5. Select Require for all fields > Save rule.
  6. Click Create new rule > Field requirements.
  7. Select Require for all fields > Save rule.

Expected Result:

Rule should be saved.

Actual Result:

"Please select at least one field" is shown when all fields are selected.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7222630_1785494644465.1.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jul 31, 2026
  2. applause-bot commented on Jul 31, 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/dc404983336b54b77494cba2ab535a1ae1946149fe6ef4ea3d2a869f00975a84

  3. melvin-bot commented on Jul 31, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jul 31, 2026

    @melvin-bot

    @JS00001 @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #96591

  5. melvin-bot commented on Jul 31, 2026

    @melvin-bot

    @Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #96591

  6. melvin-bot commented on Jul 31, 2026

    @melvin-bot

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

  7. github-actions commented on Jul 31, 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.
  8. MelvinBot commented on Jul 31, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug (fix is entirely in Expensify/App)
    Causing PR: #96591 - "Add contextual Category rules section to category details RHP" by @Krishna2323 (Medium-High confidence)
    Related Issues: #92742 (the feature issue this PR implemented)

    Recommendation: ROLL FORWARD

    The blocker is surfaced by a pre-existing validation quirk that #96591's new category-scoped "Create new rule" flow makes reachable. A targeted fix (differentiate "nothing selected" from "already required") is far narrower and safer than reverting the whole contextual-rules feature, and the revert would remove otherwise-working functionality. REVERT of #96591 is a viable fallback if a fix cannot land quickly.

    Assigned: @Krishna2323 (PR author), @JS00001 and @situchan (approving reviewers) — already assigned by Melvin.
    Labels: No changes. Only DeployBlockerCash is present; this is a Frontend bug so it correctly stays (the App deploy is blocked). DeployBlocker was not present and nothing is removed.

    📋 Detailed Analysis

    Evidence

    Verification

    Root Cause

    For require-fields rules, a category's "rule" is simply the category's own required-field flags — there is no separate per-rule entity. Validation for a new rule therefore diffs the form against the category's current state:

    • getRequireFieldsRuleValidationError returns the "select at least one field" error whenever !hasRequireFieldsRuleChanges(...) for a non-edit (create) flow — see RequireFieldsRulesUtils.ts#L524-L533.
    • hasRequireFieldsRuleChanges compares effectiveForm against getRequireFieldsFormFromCategory(category) (the category's current required flags) — see RequireFieldsRulesUtils.ts#L231-L255.

    Sequence:

    1. First create "Require for all fields": category has no requirements → effectiveForm (all REQUIRE) differs from category (DO_NOT_REQUIRE) → hasChanges = true → saves. saveRequireFieldsRule optimistically writes the required flags onto the category in Onyx.
    2. Second create "Require for all fields" on the same locked category: the category now already requires all fields, so getRequireFieldsFormFromCategory(category) returns all REQUIRE. The user's selection (all REQUIRE) now equals the category state → hasRequireFieldsRuleChanges returns false → the error fires even though every field is visibly selected.

    This is not the "nothing selected" case the message describes — it is a redundant no-op (the category already requires everything). The create flow lacks the graceful no-op handling that the edit flow already has: for editing, handleSave clears the draft and navigates back on no-change (RequireFieldsRulePageBase.tsx#L351-L355), whereas the create flow maps the same no-op to the misleading error via errorMessage/handleSubmit.

    Suggested targeted fix

    Differentiate the two states in getRequireFieldsRuleValidationError (or handleSave): only show confirmErrorDoNotRequireField when the effective form genuinely requires no field. When the form does require at least one field but produces no delta because the category already requires it, treat it as a redundant no-op — clear the draft and navigate back gracefully (mirroring the edit-flow no-op at RequireFieldsRulePageBase.tsx#L351-L355) rather than blocking with an error.

  9. JS00001 commented on Jul 31, 2026

    @JS00001
    Contributor

    This is behind a beta

  10. 4 remaining items

  11. added
    Weekly
    and removed
    Daily
    on Aug 3, 2026
  12. Krishna2323 commented on Aug 3, 2026

    @Krishna2323
    Contributor

    PR is ready for review: #97729

    cc: @situchan

  13. added
    Daily
    and removed
    Reviewing
    Weekly
    on Aug 10, 2026
  14. changed the title [-]Rules - "Please select at least one field" is shown when all fields are selected[/-] [+][Due for payment 2026-08-17] Rules - "Please select at least one field" is shown when all fields are selected[/+] on Aug 10, 2026
  15. melvin-bot commented on Aug 10, 2026

    @melvin-bot

    @Krishna2323 / @situchan

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.51-1 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 2026-08-17. 🎊

    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]. If no checklist is needed for this issue, you can click: [no checklist button]

  16. JS00001 commented on Aug 11, 2026

    @JS00001
    Contributor

    This will be paid separately, as a part of a project

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions