Skip to content

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

Closed

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

Activity

  1. added
    Daily
    NewFeature
    on May 9, 2025
  2. melvin-bot commented on May 9, 2025

    @melvin-bot

    Triggered auto assignment to @Christinadobrzyn (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

  3. melvin-bot commented on May 9, 2025

    @melvin-bot

    ⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

  4. added
    External
    and removed
    Weekly
    NewFeature
    on May 9, 2025
  5. melvin-bot commented on May 9, 2025

    @melvin-bot

    Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

  6. changed the title [-]Calculate missing comment for category on the client[/-] [+][$250] Calculate missing comment for category on the client[/+] on May 9, 2025
  7. melvin-bot commented on May 9, 2025

    @melvin-bot
  8. added
    Help Wanted
    on May 9, 2025
  9. 40 remaining items

  10. melvin-bot commented on Jun 4, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.58-4 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 2025-06-11. 🎊

    For reference, here are some details about the assignees on this issue:

  11. melvin-bot commented on Jun 4, 2025

    @melvin-bot

    @rojiphil @Christinadobrzyn @rojiphil The PR fixing this issue has been merged! 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]

  12. Christinadobrzyn commented on Jun 11, 2025

    @Christinadobrzyn
    Contributor

    @rojiphil can you let us know about a regression test?

    Payment summary here - #61790 (comment)

    Moving to daily.

  13. added
    Daily
    and removed
    Weekly
    on Jun 11, 2025
  14. added
    Daily
    and removed
    Daily
    on Jun 11, 2025
  15. Christinadobrzyn commented on Jun 12, 2025

    @Christinadobrzyn
    Contributor

    nudge @rojiphil can you let us know about a regression test?

  16. rojiphil commented on Jun 12, 2025

    @rojiphil
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: Not Required. The existing checklist is good enough to capture such issues.

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    https://github.com/Expensify/Expensify/issues/513365

    Regression Test Proposal

    Precondition:

    Test:

    Test 1:
    Precondition: Workspace with Rules enabled

    1. Go to Categories and press on any category
    2. Then set the category rule with a rule set that requires a description, flags amounts over $200, and always requires receipt (The workspace rule shouldn't require receipts as part of its rules, only the category above should)
    3. Create a money request for $300 without description and category
    4. Turn offline and change the category to the one in (1)
    5. Verify the violations "Description required for selected category", "receipt required", and "amount over $200/person category limit" are shown
    6. Add a description and update the amount to $10
    7. Verify the violations disappear

    Test 2:
    Precondition: Create an expense with a valid receipt image.

    1. Go Offline.
    2. Navigate to the expense report and open the receipt image.
    3. Click on ThreeDots menu and Delete receipt.
    4. Verify that the receipt image is removed.
    5. Edit the Amount to a different amount.
    6. Verify that the receipt image do not show a dummy receipt.

    Do we agree 👍 or 👎

  17. rojiphil commented on Jun 12, 2025

    @rojiphil
    Contributor

    can you let us know about a regression test?

    Payment summary here - #61790 (comment)

    @Christinadobrzyn BZ checklist done. This is an improvement feature but we can add regression test cases for the same to prevent future regressions.
    Also, please note that we had fixed another issue along with the improvement as mentioned here, here and here.
    So, can we increase the compensation to $375 (i.e. $125 on top of $250) to accommodate the extra work involved?
    cc @MarioExpensify @cead22

  18. Christinadobrzyn commented on Jun 13, 2025

    @Christinadobrzyn
    Contributor

    Thanks @rojiphil!

    @MarioExpensify @cead22 can you lend your thoughts on the payment of this? #61790 (comment)

  19. cead22 commented on Jun 13, 2025

    @cead22
    ContributorAuthor

    ✅ 👍

  20. Christinadobrzyn commented on Jun 13, 2025

    @Christinadobrzyn
    Contributor

    Thanks @cead22! I updated the payment summary to $375 (i.e. $125 on top of $250)

    Regression test here #61790 (comment)

    @rojiphil please request payment through ND. Closing!

  21. garrettmknight commented on Jun 19, 2025

    @garrettmknight
    Contributor

    $375 approved for @rojiphil

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions