Skip to content

[Due for payment 2026-10-28] [$175] [Exploratory] Spend Rules - Clicking Edit spend rule leads to Rules > General page #101699

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.90-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/74701727/folder/57609992/101177362/1775330491
Email or phone of affected tester (no customers): applausetester+bm890019ik@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Web, android
App Component: Workspace Settings

Action Performed:

Preconditions:
Use expensifail account
Enable rules
Have a collect workspace with Expensify Card enabled and issue one Expensify Card

  1. Go to staging.new.expensify.com
  2. Click on the card that's issued
  3. Click on edit spend rule > upgrade

Expected Result:

App should navigate to Spend Rule form page

Actual Result:

Clicking Edit spend rule leads to Rules > General page

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7263630_1789769869155.bandicam_2026-09-19_00-54-23-063.mp4

View all open jobs on GitHub

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

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

Activity

  1. applause-bot commented on Sep 21, 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/7e0da7afac1647ccaca1c1167992cd4350b13ba514b77ed8d17659c098529848

  2. MelvinBot commented on Sep 21, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The workspace spend-rule pages never tell the upgrade page where to come back to, so it falls back to the workspace Rules page.

    On a Collect workspace, "Edit spend rules" on the card details page navigates to the spend-rule screen (DynamicWorkspaceExpensifyCardDetailsPage.tsx:248-258). That screen renders SpendRulePageBase without the optional upgradeBackTo prop (EditSpendRulePage.tsx:12-19, AddSpendRulePage.tsx:12-19).

    Because Rules is Control-only, useControlOnlyRuleUpgradeRedirect immediately replaces the form with the upgrade page, and with no backTo given it substitutes the workspace Rules route (useControlOnlyRuleUpgradeRedirect.ts:33). After upgrading, the upgrade page honours that backTo faithfully (WorkspaceUpgradePage.tsx:186-188) — so the user lands on Rules, which resolves to the General tab. The upgrade page is not the bug; the missing destination upstream is.

    The same screen reached from Wallet works correctly because it does pass the prop (WalletExpensifyCardSpendRulesPage.tsx:24).

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

    Pass upgradeBackTo from the two workspace spend-rule pages, mirroring the Wallet page:

    • In EditSpendRulePage, set it to ROUTES.RULES_SPEND_EDIT.getRoute(policyID, ruleID).
    • In AddSpendRulePage, set it to ROUTES.RULES_SPEND_NEW.getRoute(policyID).

    After the upgrade, the user returns to the spend-rule form they asked for. Re-entering is safe: the policy is Control by then, so the hook's isCollectPolicy check is false and it will not redirect again.

    Supporting detail
    • The landing tab is General because the fallback route carries no ?tab=, and PolicyRulesPageRevamp forces Collect users onto the General tab (PolicyRulesPageRevamp.tsx:91-109).
    • Alternative considered: change the hook's default backTo to include the Card restrictions tab. That hides the symptom for every caller but still never returns the user to the form, so it is worse.
    • Related latent gaps in the same flow: SpendRuleCardPage.tsx:110 and SpendRuleCategoryPage.tsx:26 also call the hook with no backTo. Worth deciding whether they belong in the same PR.
    • No test covers this: tests/ui/SpendRuleCardPageTest.tsx mocks the redirect hook out entirely.
    • Not verified on a live build — the repro needs a Collect workspace with an issued Expensify Card. Confidence comes from the code path, which explains every reported symptom.

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


    view run

  3. melvin-bot commented on Sep 24, 2026

    @melvin-bot

    @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  4. melvin-bot commented on Sep 28, 2026

    @melvin-bot

    @situchan Still overdue 6 days?! Let's take care of this!

  5. melvin-bot commented on Sep 30, 2026

    @melvin-bot

    @situchan 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  6. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    @situchan 10 days overdue. Is anyone even seeing these? Hello?

  7. melvin-bot commented on Oct 3, 2026

    @melvin-bot

    @situchan 10 days overdue. I'm getting more depressed than Marvin.

  8. situchan commented on Oct 7, 2026

    @situchan
    Contributor

    @MelvinBot implement this for testing

  9. 23 remaining items

  10. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 24, 2026
  11. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  13. mallenexpensify commented on Oct 30, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @situchan due $175 via NewDot

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

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions