Skip to content

[Due for payment 2026-10-28] Rules - Describe rule modal is not cleared after command fails and page is refreshed #103930

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.5.8-3
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: #99624
Email or phone of affected tester (no customers): [email protected]
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:

  • Create a Control workspace.
  • Enable Rules.
  • Enable describeRule beta.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Rules.
  3. Click Add rule > Restrict card spend.
  4. Click Describe.
  5. Enter lala.
  6. Click Next.
  7. After error shows up, refresh the page.
  8. Click Describe.

Expected Result:

Describe rule modal will be cleared after command fails and page is refreshed.

Actual Result:

Describe rule modal is not cleared after command fails and page is refreshed.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7285539_1791910680111.17.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7285539

Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

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

    @melvin-bot

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

  3. applause-bot commented on Oct 13, 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/8f409d30c43482aa6cefdc41e25e99979b03f5e4cac8ffdb6f1c93655884df99

  4. melvin-bot commented on Oct 13, 2026

    @melvin-bot

    @luacmartins @JS00001 @Krishna2323 you have been assigned to this deploy blocker because you reviewed the offending PR: #99624

  5. melvin-bot commented on Oct 13, 2026

    @melvin-bot

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

  6. melvin-bot commented on Oct 13, 2026

    @melvin-bot

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

  7. github-actions commented on Oct 13, 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. JS00001 commented on Oct 13, 2026

    @JS00001
    Contributor

    Closing because the button is behind a beta now, adding to the list though

  9. MelvinBot commented on Oct 13, 2026

    @MelvinBot
    Contributor

    Deploy blocker analysis

    Verdict: Not a real blocker — demote and fix forward. No revert needed. JS00001 already closed this because the Describe button is now behind the describeRule beta ([cp staging] Hide Describe rule button behind a client side beta).

    Causing PR: AI-assisted rule creation (high confidence, from code reading).

    Root cause: The prompt input uses shouldSaveDraft (DescribeRuleModal.tsx:169), so the text persists in Onyx. The draft is only cleared by close() (DescribeRuleModal.tsx:77-81). A refresh after an error skips close(), and the reload cleanup effect (DescribeRuleModal.tsx:96-101) only runs when isLoading is still true. After a failure, isLoading is false, so the old text returns.

    Recommended fix: In DescribeRuleModal.tsx, call clearNewRulePrompt() once on mount. This clears the stale prompt, error, and generatedRule, and covers the existing leftover-loading case.

    Investigation details
    • FormProvider writes each keystroke to the draft key (FormProvider.tsx:561-562) and restores it on mount (FormProvider.tsx:434).
    • clearNewRulePrompt() resets the form, draft, and generatedRule (Rules.ts:460-464).
    • failureData (Rules.ts:433-439) only sets isLoading: false and errors. Keeping the prompt after an error while the modal stays open matches the spec.
    • The persisted errors value is read by FormProvider (FormProvider.tsx:185), so the old error likely reappears after refresh too. Not verified in the app.
    • The modal children render only when visible (ReanimatedModal/index.tsx:256), so a mount-time clear runs before the form reads the draft.
    • Smaller alternative: remove shouldSaveDraft. This fixes the text but leaves the persisted error.
    • Impact is cosmetic and beta-gated. Nothing is saved incorrectly.

    Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.


    view run

  10. added
    ReviewingHas a PR in review
    and removed
    ReviewingHas a PR in review
    on Oct 15, 2026
  11. changed the title [-]Rules - Describe rule modal is not cleared after command fails and page is refreshed[/-] [+][Due for payment 2026-10-28] Rules - Describe rule modal is not cleared after command fails and page is refreshed[/+] on Oct 21, 2026
  12. melvin-bot commented on Oct 21, 2026

    @melvin-bot

    @Krishna2323

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.15-3 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-10-28. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions