Skip to content

[Due for payment 2025-06-11] [$250] Calculate missingComment, overCategoryLimit, and receiptRequired (for category) violations on the client #61790

@cead22

Description

@cead22

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: v9.1.43-5
Reproducible in staging?: Y
Reproducible in production?: Y

Action Performed:

Note that this is currently working as designed, so this is more a feature request than a bug report, but I'm using the same template

  1. Create workspace with a category that requires a description, flags amounts over $200, and always requires receipt
  2. The workspace shouldn't require receipts as part of its rules, only the category above should
  3. Create a money request for $300 and set the category that requires description
  4. Notice the violations "Description required for selected category", "receipt required", and "amount over $200/person category limit" are shown
  5. Go offline
  6. Add a description and update the amount to $10
  7. Notice how the violations "Description required for selected category", and "amount over $200/person category limit" don't disappear, since we calculate these violation only on the server
  8. Go online
  9. Wait a bit
  10. Notice the violations disappears

Expected Result:

The violation should disappear

Actual Result:

The violations doesn't disappear, since we calculate this violation only on the server

Solution

  • Let's calculate the missingComment violation on the client
  • We have the information already in onyx inside the policyCategories_policyID key
  • If the description is empty and the money request category is set to one that requires a comment, display the violatino
  • If the description is not empty and the money request category is set to one that requires a comment, don't display the violation
  • Let's put this logic where the other logic calculating violations on the client is

Platforms:

This should work the same in all platforms

Screenshots/Videos

Image Image Image Image Image
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021920875184493148775
  • Upwork Job ID: 1920875184493148775
  • Last Price Increase: 2025-05-09
  • Automatic offers:
    • FitseTLT | Contributor | 107291199
Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions