Skip to content

[$250] Expense - Error after holding expense and approving unheld expense as vacation delegate #65003

Closed

Description

@mitarachim

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: 9.1.71-8
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 TestRail: #61845
Email or phone of affected tester (no customers): sdnjoidsjosdjsojo2@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Invite User B to the workspace.
  4. Go to Account > Status > Vacation delegate.
  5. Add User B as vacation delegate and click Save.
  6. Go to workspace chat.
  7. Submit an expense to the workspace chat.
  8. Click Submit on the expense preview.
  9. As User B, open the expense report.
  10. Click More > Split > Save.
  11. Refresh the page.
  12. Open any expense row.
  13. Click More > Hold > Enter reason and save it.
  14. Close the RHP.
  15. Click Approve.
  16. Approve only the pending amount.
  17. Dismiss the error.

Expected Result:

In Step 16, no error will show up after approving only the pending amount.

Actual Result:

In Step 16, error shows up after approving only the pending amount.
In Step 17, after dismissing the error, the unheld expense is approved.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6870627_1750940011061.20250626_201024.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021938657491960233700
  • Upwork Job ID: 1938657491960233700
  • Last Price Increase: 2025-07-18
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @deetergp

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Jun 26, 2025
  2. melvin-bot commented on Jun 26, 2025

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. melvin-bot commented on Jun 26, 2025

    @melvin-bot

    Triggered auto assignment to @madmax330 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. github-actions commented on Jun 26, 2025

    @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.
  5. melvin-bot commented on Jun 26, 2025

    @melvin-bot

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

  6. dangrous commented on Jun 26, 2025

    @dangrous
    Contributor

    So this is a new feature and it doesn't look like there were any changes to the backend related to it in this deploy. I'm going to remove the DeployBlocker label (but keep DeployBlockerCash) so it won't block our deploy. Also cc @deetergp since I think you're looking at these ones?

  7. removed
    DeployBlocker
    on Jun 26, 2025
  8. 47 remaining items

  9. changed the title [-][HOLD App #65838][$250] Expense - Error after holding expense and approving unheld expense as vacation delegate[/-] [+][$250] Expense - Error after holding expense and approving unheld expense as vacation delegate[/+] on Aug 1, 2025
  10. added
    Daily
    and removed
    Weekly
    on Aug 1, 2025
  11. deetergp commented on Aug 1, 2025

    @deetergp
    Contributor

    #65838 has been deployed so this is now off hold and back to being a daily. Per this convo I am going to start working on this issue first.

  12. deetergp commented on Aug 2, 2025

    @deetergp
    Contributor

    I've spent some time with this today and have figured out what is happening, and I think I've also figured out why it's happening.

    • I suspect this is some kind of race condition, though I’m not entirely certain why it has anything to do with the Vacation Delegates feature. Here are the steps:
      • Create the expense & submit it to the reviewer/vacation delegate
        • The expense goes on a report
      • The reviewer/vacation delegate splits the expense
        • Two new split transactions are created on that same report
        • The original expense is moved to a phony report (reportID -2)
      • Reviewer selects one of the splits and puts it on hold
        • Splits are still on the same report
      • Reviewer clicks Approve for the un-held expense
        • The held report is put on a new reportID
        • The Report no longer exists error is thrown here when we try to load the new report via its reportID

    When we create that new report for the held expense, we are not sharing it with the vacation delegate/reviewer:

    sqlite> SELECT * FROM transactions ORDER BY inserted DESC limit 3;
    created     transactionID        cardID  reportID          receiptID  amount  merchant  mcc  state  comment                                                                                                                                                                                                                                                                                                              tag  externalID  memo  inserted             currency  modifiedCreated  modifiedAmount  modifiedMerchant  modifiedMCC  category     transactionHash                               modifiedCurrency
    ----------  -------------------  ------  ----------------  ---------  ------  --------  ---  -----  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ---  ----------  ----  -------------------  --------  ---------------  --------------  ----------------  -----------  -----------  --------------------------------------------  ----------------
    2025-08-01  2046402530088489562  734     1407636802737367             -9000   rwvw           -3     {"attendees":[{"avatarUrl":"https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_6.png","displayName":"Admin Inviter","email":"deetertest+adminviter@gmail.com"}],"comment":"","isDemoTransaction":true,"originalTransactionID":"6439828532949217192","source":"split","hold":"4380882293079114514"}                         2025-08-01 23:45:11  USD       2025-08-01       -4500           rwvw                           Advertising  hash97D1AA6CA65FF5B79A2A665DA8C2F28FC454B984
    2025-08-01  6157731886545980855  734     7706205579606560             -9000   rwvw           -3     {"attendees":[{"avatarUrl":"https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_6.png","displayName":"Admin Inviter","email":"deetertest+adminviter@gmail.com"}],"comment":"","isDemoTransaction":true,"originalTransactionID":"6439828532949217192","source":"split"}                                                      2025-08-01 23:45:11  USD       2025-08-01       -4500           rwvw                           Advertising  hashE77FA0BEC0FEC4D8F6B4D17AB1FADA24D6CB371C
    2025-08-01  6439828532949217192  734     -2                           -9000   rwvw           -3     {"attendees":[{"avatarUrl":"https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_6.png","displayName":"Admin Inviter","email":"deetertest+adminviter@gmail.com"}],"comment":"","isDemoTransaction":true}                                                                                                                     2025-08-01 23:44:31  USD                                                                       Advertising  hashA2D548285CC36CABE721F341F2C8E3FEE3E4F980
    sqlite> SELECT * FROM sharedReports WHERE reportID = 1407636802737367;
    sqlite> SELECT * FROM sharedReports WHERE reportID = 7706205579606560;
    accountID  reportID          permissions         created
    ---------  ----------------  ------------------  -----------------------
    1306       7706205579606560  read, write, share  2025-08-01 23:45:00.041
    

    Now I just need to figure out how to make sure we share when the delegate/reviewer clicks the Approve button…

  13. melvin-bot commented on Aug 5, 2025

    @melvin-bot

    @deetergp Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. deetergp commented on Aug 6, 2025

    @deetergp
    Contributor

    The code for this is pretty nearly done. Spent today learning how to use Cursor/Claude while writing a test for this. Likely have it out for review later tonight or in the morning.

  15. added
    Reviewing
    on Aug 6, 2025
  16. deetergp commented on Aug 13, 2025

    @deetergp
    Contributor
  17. deetergp commented on Aug 13, 2025

    @deetergp
    Contributor

    Thanks @m-natarajan! Closing this one out.

  18. moved this from Second Cohort - HIGH to Done in [#whatsnext] #migrateon Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineeringInternalReviewing

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions