Skip to content

[Due for payment 2025-08-11] [$50] Expense - Splits show error after non-admin approver splits the expense #65324

Closed

Description

@jponikarchuk

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.74-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exploratory https://expensify.testrail.io/index.php?/tests/view/6416429
Email or phone of affected tester (no customers): applausetester+010712kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Create a workspace with admin, non-admin approver and member.
  1. Go to staging.new.expensify.com
  2. [Member} Go to workspace chat.
  3. [Member] Add an expense to the workspace chat. Do not click Submit button on expense preview.
  4. [Non-admin approver] Go to workspace chat with member.
  5. [Non-admin approver] Open the expense report.
  6. [Non-admin approver] Click More > Split.
  7. [Non-admin approver] Click Save.

Expected Result:

Non-admin approver should be able to split the expense.

Actual Result:

Non-admin approver is unable to split the expense. The splits show error after non-admin approver splits the expense.

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

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021942678222792202966
  • Upwork Job ID: 1942678222792202966
  • Last Price Increase: 2025-07-28
Issue OwnerCurrent Issue Owner: @strepanier03 / @CortneyOfstad

Activity

  1. added
    Daily
    Bug
    on Jul 2, 2025
  2. melvin-bot commented on Jul 2, 2025

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. CortneyOfstad commented on Jul 2, 2025

    @CortneyOfstad
    Contributor

    @jponikarchuk I'm confused by step 3:

    Submit an expense to the workspace chat. Do not click Submit button on expense preview.

    It mentions submitting the expense, but then states to not submit. Can you provide clarification?

  4. jponikarchuk commented on Jul 2, 2025

    @jponikarchuk
    Author

    @CortneyOfstad We mean that user should create an expense in the workspace chat but not click on Submit button.

  5. linhvovan29546 commented on Jul 7, 2025

    @linhvovan29546
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-07-24 10:26:18 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Expense - Splits show error after non-admin approver splits the expense

    What is the root cause of that problem?

    The BE does not allow a non-admin approver to split an expense if the expense is still open.

    Image

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

    We should not display the split expense action if the expense is still open for non-admin approvers.

    return isSubmitter || isAdmin || isManager;

         if (isOpen) {
             return isSubmitter || isAdmin;
         }
        return isSubmitter || isAdmin || isManager;

    I think we also handle a similar check on SplitExpensePage and SplitExpenseEditPage, so we can export the isSplitAction function and apply the same check here to display the 'Not Found' page.

    import { isSplitAction as isSplitActionUtil } from '@libs/ReportSecondaryActionUtils';
    
    ...
        const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportID)}`, {canBeMissing: true});
        const policy=usePolicy(report?.policyID);
        const isSplitAction= report && transaction && isSplitActionUtil(report,[transaction],policy)
        // eslint-disable-next-line rulesdir/no-negated-variables
        const shouldShowNotFoundPage = isEmptyObject(draftTransaction) || !reportID || !isSplitAction
    ...
                <FullPageNotFoundView shouldShow={shouldShowNotFoundPage}>

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Write a unit test for getSecondaryReportActions to ensure it does not return the SPLIT action for non-admin approvers when the expense is open.

    What alternative solutions did you explore? (Optional)

    N/A

  6. melvin-bot commented on Jul 8, 2025

    @melvin-bot

    @CortneyOfstad Eep! 4 days overdue now. Issues have feelings too...

  7. CortneyOfstad commented on Jul 8, 2025

    @CortneyOfstad
    Contributor

    Thanks for the clarification @jponikarchuk! Getting eyes on this!

  8. added
    External
    on Jul 8, 2025
  9. melvin-bot commented on Jul 8, 2025

    @melvin-bot
  10. changed the title [-]Expense - Splits show error after non-admin approver splits the expense[/-] [+][$250] Expense - Splits show error after non-admin approver splits the expense[/+] on Jul 8, 2025
  11. added
    Help Wanted
    on Jul 8, 2025
  12. 67 remaining items

  13. strepanier03 commented on Aug 12, 2025

    @strepanier03
    Contributor

    Payment summary

  14. strepanier03 commented on Aug 12, 2025

    @strepanier03
    Contributor

    @rushatgabhane @ZhenjaHorbach - Do we need a reg test? Can one of you complete the checklist?

  15. linhvovan29546 commented on Aug 12, 2025

    @linhvovan29546
    Contributor

    @strepanier03 I also need to be paid here as well #65324 (comment)

  16. strepanier03 commented on Aug 12, 2025

    @strepanier03
    Contributor

    Thanks for the bump @linhvovan29546 I missed that before.

    I've updated the payment summary, completed the payment for you, and closed the contract.

  17. strepanier03 commented on Aug 14, 2025

    @strepanier03
    Contributor

    @ZhenjaHorbach @rushatgabhane - Do we need a checklist and reg test here? The payment summary is on hold since that's outstanding still.

  18. strepanier03 commented on Aug 18, 2025

    @strepanier03
    Contributor

    Checklist outstanding.

  19. rushatgabhane commented on Aug 19, 2025

    @rushatgabhane
    Member

    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 (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. 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: Split expense flow v2 Phase1 #63092 (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 critical

    • [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.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    Precondition: Create a workspace with admin, non-admin approver and member.

    1. Open App
    2. [Member} Go to workspace chat.
    3. [Member] Add an expense to the workspace chat. Do not click Submit button on expense preview.
    4. [Non-admin approver] Go to workspace chat with member.
    5. [Non-admin approver] Open the expense report.
    6. [Non-admin approver] Click More
    7. Verify that the split button is not displayed if the expense is still open for non-admin approvers

    Do we agree 👍 or 👎

  20. rushatgabhane commented on Aug 19, 2025

    @rushatgabhane
    Member

    @strepanier03 i think i should be paid $250 here for reviewing #67241 (comment)

    $50 is for @linhvovan29546 because they helped with root cause

  21. strepanier03 commented on Aug 20, 2025

    @strepanier03
    Contributor

    @rushatgabhane - Thanks for the context, I updated the payment summary. Do you know if @ZhenjaHorbach should also be $250?

  22. strepanier03 commented on Aug 22, 2025

    @strepanier03
    Contributor

    @rushatgabhane @ZhenjaHorbach - Payment summary is above.

  23. garrettmknight commented on Sep 11, 2025

    @garrettmknight
    Contributor

    $250 approved for @rushatgabhane

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

Metadata

Metadata

Labels

Awaiting PaymentBugDaily

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions