Skip to content

[$250] Expense - User can change the expense from SelfDM to a report in Expired Workspace #80205

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: v9.3.6-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #79869
Email or phone of affected tester (no customers): luongquocvu92+070125@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 10/Chrome
App Component: Workspace Settings

Action Performed:

Preconditions: User is an admin of an expired workspace and has a draft report in it before

  1. Log in to the NewDot app
  2. Navigate to selfDM, create an expense
  3. Click on the track expense
  4. Click on the report row
  5. Select the draft report in the expired Workspace

Expected Result:

Add card payment banner RHP display

Actual Result:

User can move the expense in the SelfDM to a draft report in an expired workspace

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022015797782263639485
  • Upwork Job ID: 2015797782263639485
  • Last Price Increase: 2026-02-02
  • Automatic offers:
    • etCoderDysto | Contributor | 110335663
Issue OwnerCurrent Issue Owner: @AndrewGable

Activity

  1. added
    Daily
    Bug
    on Jan 22, 2026
  2. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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. etCoderDysto commented on Jan 22, 2026

    @etCoderDysto
    Contributor

    Proposal

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

    User can change the expense from SelfDM to a report in Expired Workspace

    What is the root cause of that problem?

    We are not checking if user is performing restricted billable action

    const handleSelectReport = (item: TransactionGroupListItem) => {
    if (item.value === selectedReportID) {
    navigateBack();
    return;
    }
    if (!validatePerDiemMove(item.policyID)) {
    return;
    }
    selectReport(item);

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

    We should check if the user is performing restricted billable action and navigate to the right page like we are already doing for handleCreateReport. We should check other places that require the same change

            if (item?.policyID && shouldRestrictUserBillableActions(item.policyID)) {
                Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(item.policyID));
                return;
            }
    

    What alternative solutions did you explore? (Optional)

    We can move shouldRestrictUserBillableActions to selectedReport function call

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. daledah commented on Jan 22, 2026

    @daledah
    Contributor

    Proposal

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

    Users can move expenses from selfDM to a draft report in an expired workspace. This should not be allowed - the app should show the "Add card payment" banner (restricted action RHP) instead of allowing the move.

    What is the root cause of that problem?

    In IOURequestEditReportCommon.tsx, the handleSelectReport function validates for PerDiem transactions but does NOT check if the destination workspace has an expired subscription using shouldRestrictUserBillableActions:

    const handleSelectReport = (item: TransactionGroupListItem) => {
    if (item.value === selectedReportID) {
    navigateBack();
    return;
    }
    if (!validatePerDiemMove(item.policyID)) {
    return;
    }
    selectReport(item);
    };

    Other parts of the codebase (like MoneyRequestParticipantsSelector, FloatingActionButtonAndPopover, SettlementButton, etc.) correctly check shouldRestrictUserBillableActions before allowing billable actions, but this check is missing when moving expenses to a different report.

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

    Add a check for shouldRestrictUserBillableActions in handleSelectReport before allowing the expense to be moved:

    import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils';
    import ROUTES from '@src/ROUTES';
    
    const handleSelectReport = (item: TransactionGroupListItem) => {
        if (item.value === selectedReportID) {
            navigateBack();
            return;
        }
        
        // Check if destination workspace has expired subscription
        if (item.policyID && shouldRestrictUserBillableActions(item.policyID)) {
            Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(item.policyID));
            return;
        }
        
        if (!validatePerDiemMove(item.policyID)) {
            return;
        }
        selectReport(item);
    };

    The same check should also be added to handleCreateReport:

    const handleCreateReport = useCallback(() => {
        // Check if policy for new report has expired subscription
        if (policyForMovingExpenses?.id && shouldRestrictUserBillableActions(policyForMovingExpenses.id)) {
            Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policyForMovingExpenses.id));
            return;
        }
        
        if (!validatePerDiemMove(policyForMovingExpenses?.id)) {
            return;
        }
        createReport?.();
    }, [validatePerDiemMove, policyForMovingExpenses?.id, createReport]);

    What alternative solutions did you explore? (Optional)

  5. added
    External
    on Jan 26, 2026
  6. changed the title [-]Expense - User can change the expense from SelfDM to a report in Expired Workspace[/-] [+][$250] Expense - User can change the expense from SelfDM to a report in Expired Workspace[/+] on Jan 26, 2026
  7. melvin-bot commented on Jan 26, 2026

    @melvin-bot
  8. added
    Help Wanted
    on Jan 26, 2026
  9. melvin-bot commented on Jan 26, 2026

    @melvin-bot

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

  10. dukenv0307 commented on Jan 27, 2026

    @dukenv0307
    Contributor

    @etCoderDysto'ss proposal looks good to me.
    This is the first proposal that is sufficient to solve the problem.

    🎀👀🎀 C+ reviewed

  11. 8 remaining items

  12. removed
    Help Wanted
    on Feb 3, 2026
  13. melvin-bot commented on Feb 3, 2026

    @melvin-bot

    📣 @etCoderDysto 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

    Offer link
    Upwork job
    Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
    Keep in mind: Code of Conduct | Contributing 📖

  14. dukenv0307 commented on Feb 5, 2026

    @dukenv0307
    Contributor

    still waiting for @etCoderDystos's PR

  15. etCoderDysto commented on Feb 5, 2026

    @etCoderDysto
    Contributor

    I will raise a PR today

  16. added
    Reviewing
    Weekly
    and removed
    Daily
    on Feb 5, 2026
  17. etCoderDysto commented on Feb 5, 2026

    @etCoderDysto
    Contributor

    @dukenv0307 PR is ready for review

  18. etCoderDysto commented on Feb 26, 2026

    @etCoderDysto
    Contributor

    Hi @greg-schroeder this ready for payment. Pr was deployed two weeks ago.

  19. added
    Awaiting Payment
    on Feb 26, 2026
  20. greg-schroeder commented on Feb 26, 2026

    @greg-schroeder
    Contributor

    Payment summary:

    Author: @etCoderDysto - $250 - Upwork
    Reviewer: @dukenv0307 - $250 - ND manual request

    Approved for payments as outlined above ☝️

  21. quinthar commented on Mar 5, 2026

    @quinthar
    Contributor

    Approved $250 to @dukenv0307

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

Metadata

Metadata

Labels

Awaiting PaymentBugExternalReviewingWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions