Skip to content

[$175] Rules - Category tax rule created offline is not grayed out. #102878

Open

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.1-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: #100389
Email or phone of affected tester (no customers): ibellicotest+3215@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Workspace Settings

Action Performed:

Prerequisite: User is owner of a "Control" workspace with "Rules" enabled.

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Workspaces" > Workspace > "Rules" > "Expense Defaults"
  3. Turn off internet connection.
  4. Click on "Add Rule" > "Apply expense defaults" > "Category"
  5. Select any category and any tax and save the rule.
  6. Note that rule is created, but is not displayed grayed out, despite being created offline.
  7. Turn on internet connection.
  8. Note that rule remains.
  9. Turn off internet connection again.
  10. Select and delete the rule.
  11. Note that rule disappears automatically instead of being grayed out.

Expected Result:

Rule created offline should be displayed grayed out. Same behavior with a strikethrough should be experienced when deleting it offline.

Actual Result:

Category tax rule created offline is not displayed grayed out and it disappears automatically when deleted offline.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7274866_1790905644926.Rule_off.1.mp4

View all open jobs on GitHub

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

Upwork Automation - Do Not Edit

Activity

  1. applause-bot commented on Oct 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/17ba54cf58a51c2d5888b23c4da658521d8a6bea3a4467fa0a4eb5152f06e255

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 2, 2026
  3. MelvinBot commented on Oct 2, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    This isn't a regression from Add rules engine types and merchant rule AST helpers, and it already happens in production. It was a deliberate choice made in Add category tax defaults to Expense defaults.

    Category tax rules live in a plain array (policy.rules.expenseRules), so a single rule has nowhere to store a pendingAction:

    The reviewer reported both bugs on PR #99420. The author called them a "known tradeoff": clearing a flag inside the array needs successData that rewrites the whole array, and queued writes can then replay stale arrays over each other. JS00001 agreed to keep it "for now until we migrate to the new rules format".

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

    Put this issue on hold, or close it as a known limitation, until category tax defaults move into the keyed rules_ collection. Merchant rules already use that collection, and they gray out and strike through correctly through per-key pendingAction (see Rules.ts:259-283). Category rules get the same behavior once they move.

    What alternative solutions did you explore? (Optional)

    Here is a possible App-only stopgap, which I haven't tested:

    1. Track pending state in a separate keyed object outside the array, for example pendingCategoryTaxRules: {[categoryName]: {pendingAction, taxID}}.
    2. When you add, update, or delete a rule, set that category's pendingAction. Set it back to null in both successData and failureData. Because each write touches only one key, this avoids the stale-array replay problem.
    3. In getCategoryTaxRulesTableData, read the pending state from that object. While offline, keep rendering rows that are pending deletion.

    This is more work than the planned migration covers, so it needs an internal decision first.

    Investigation details

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


    view run

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 2, 2026
  5. melvin-bot commented on Oct 2, 2026

    @melvin-bot

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

  6. changed the title [-]Rules - Category tax rule created offline is not grayed out.[/-] [+][$175] Rules - Category tax rule created offline is not grayed out.[/+] on Oct 2, 2026
  7. melvin-bot commented on Oct 2, 2026

    @melvin-bot
  8. ProjectsNexus commented on Oct 2, 2026

    @ProjectsNexus

    Hi there! We saw the issue with the offline category tax rule not being grayed out and disappearing on delete. Our React Native experts can fix this behavior quickly and ensure it works across Android and web. Could we discuss the scope and timeline via the Upwork job link you shared?

  9. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    📣 @ProjectsNexus! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  10. camesenin commented on Oct 2, 2026

    @camesenin
  11. camesenin commented on Oct 2, 2026

    @camesenin
  12. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  13. 15 remaining items

  14. melvin-bot commented on Oct 28, 2026

    @melvin-bot

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

  15. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    @aimane-chnaif @situchan this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  16. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    @aimane-chnaif, @situchan Huh... This is 4 days overdue. Who can take care of this?

  17. melvin-bot commented on Nov 3, 2026

    @melvin-bot

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

  18. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    @aimane-chnaif, @situchan Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  19. melvin-bot commented on Nov 4, 2026

    @melvin-bot

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

  20. melvin-bot commented on Nov 5, 2026

    @melvin-bot

    @aimane-chnaif, @situchan 10 days overdue. I'm getting more depressed than Marvin.

  21. jeffrey-graham commented on Nov 7, 2026

    @jeffrey-graham
  22. melvin-bot commented on Nov 7, 2026

    @melvin-bot
  23. melvin-bot commented on Nov 10, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @aimane-chnaif, @situchan eroding to Weekly issue.

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.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions