Skip to content

[$250] Expense - "moved this expense to your personal space" is missing sender, empty message on Reports #70444

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.2.13-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #69959
Email or phone of affected tester (no customers): sdjonidsdjsiod@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Account has self DM and workspace.
  1. Go to staging.new.expensify.com
  2. Go to workspace.
  3. Create a manual expense.
  4. Create a new report.
  5. Open the expense from Step 3.
  6. Click Report.
  7. Select the new report from Step 4.
  8. Open the new report.
  9. Click Report field.
  10. Click Remove from report.
  11. Click More > Delete.
  12. Delete the report.
  13. Go to self DM and open the unreported expense.
  14. Go to Reports > Chats.

Expected Result:

In Step 13, "moved this expense to your personal space" message will show message sender.
In Step 14, there will be no empty message in Reports > Chats.

Actual Result:

In Step 13, "moved this expense to your personal space" message does not show message sender.
In Step 14, there is an empty message in Reports > Chats.

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/~021967638906678553589
  • Upwork Job ID: 1967638906678553589
  • Last Price Increase: 2025-09-22
Issue OwnerCurrent Issue Owner: @chuckdries

Activity

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

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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. nkdengineer commented on Sep 12, 2025

    @nkdengineer
    Contributor

    Proposal

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

    In Step 13, "moved this expense to your personal space" message does not show message sender.
    In Step 14, there is an empty message in Reports > Chats.

    What is the root cause of that problem?

    The moved this expense to your personal space action doesn't show the sender because it's grouped with the previous moved action.

    displayAsGroup={
    !isConsecutiveChronosAutomaticTimerAction(sortedVisibleReportActions, index, chatIncludesChronosWithID(reportAction?.reportID)) &&
    isConsecutiveActionMadeByPreviousActor(sortedVisibleReportActions, index)
    }
    mostRecentIOUReportActionID={mostRecentIOUReportActionID}
    shouldHideThreadDividerLine={shouldHideThreadDividerLine}

    displayAsGroup is true because we don't return early if the action is system message action and two actions are created in the short time.

    function canActionsBeGrouped(currentAction?: ReportAction, adjacentAction?: ReportAction): boolean {
    // It's OK for there to be no previous action, and in that case, false will be returned
    // so that the comment isn't grouped
    if (!currentAction || !adjacentAction) {
    return false;
    }
    // Comments are only grouped if they happen within 5 minutes of each adjacent
    if (new Date(currentAction?.created).getTime() - new Date(adjacentAction.created).getTime() > CONST.REPORT.ACTIONS.MAX_GROUPING_TIME) {
    return false;
    }
    // Do not group if adjacent action was a created action
    if (adjacentAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) {

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

    We can return early if the action/previous action is UNREPORTEDTRANSACTION/MOVEDTRANSACTION

    if (adjacentAction.actionName === CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION || currentAction.actionName === CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION) {
        return false;
    }
    
    if (adjacentAction.actionName === CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION || currentAction.actionName === CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION) {
        return false;
    }
    

    function canActionsBeGrouped(currentAction?: ReportAction, adjacentAction?: ReportAction): boolean {
    // It's OK for there to be no previous action, and in that case, false will be returned
    // so that the comment isn't grouped
    if (!currentAction || !adjacentAction) {
    return false;
    }
    // Comments are only grouped if they happen within 5 minutes of each adjacent
    if (new Date(currentAction?.created).getTime() - new Date(adjacentAction.created).getTime() > CONST.REPORT.ACTIONS.MAX_GROUPING_TIME) {
    return false;
    }
    // Do not group if adjacent action was a created action
    if (adjacentAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) {

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

    None

    What alternative solutions did you explore? (Optional)

    Update canActionsBeGrouped unit test function to verify it returns false if the action is UNREPORTEDTRANSACTION/MOVEDTRANSACTION

    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. bernhardoj commented on Sep 12, 2025

    @bernhardoj
    Contributor

    Proposal

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

    "moved this expense to your personal space" action is missing sender and empty message on Reports

    What is the root cause of that problem?

    The sender won't show if it's a consecutive message within the time limit. In our case, there is a hidden MOVEDTRANSACTION action. It doesn't show because the toReport is missing (because we already delete it), so we render nothing.

    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION) {
    const movedTransactionOriginalMessage = getOriginalMessage(action as OnyxTypes.ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION>) ?? {};
    const {toReportID} = movedTransactionOriginalMessage as OriginalMessageMovedTransaction;
    const toReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${toReportID}`];
    // When expenses are merged multiple times, the previous toReportID may reference a deleted report,
    // making it impossible to retrieve the report name for display
    // Ref: https://github.com/Expensify/App/issues/70338
    if (!toReport) {
    children = emptyHTML;
    } else {
    children = (

    It's the same case on the Reports > Chats page.

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

    We have 2 options.

    The simplest one, we can just render the message even though the toReport is missing, so it will just show "moved this expense" without the report name.

    The other option is to filter out in ReportActionsUtils.shouldReportActionBeVisible.

    if (isMovedTransactionAction(reportAction)) {
        const movedTransactionOriginalMessage = getOriginalMessage(reportAction);
        const toReportID = movedTransactionOriginalMessage?.toReportID;
        const toReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${toReportID}`];
        return !!toReport;
    }
    

    And add the shouldReportActionBeVisible to getReportActionsSections filter logic too.

    App/src/libs/SearchUIUtils.ts

    Lines 1336 to 1345 in 6d9f878

    if (
    isDeletedAction(reportAction) ||
    isResolvedActionableWhisper(reportAction) ||
    reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED ||
    isCreatedAction(reportAction) ||
    isWhisperActionTargetedToOthers(reportAction) ||
    (isMoneyRequestAction(reportAction) && !!report?.isWaitingOnBankAccount && originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && !isSendingMoney)
    ) {
    continue;
    }

    !shouldReportActionBeVisible(reportAction, reportAction.reportActionID, canUserPerformWriteAction(report))
    

    App/src/libs/SearchUIUtils.ts

    Lines 1336 to 1345 in 6d9f878

    if (
    isDeletedAction(reportAction) ||
    isResolvedActionableWhisper(reportAction) ||
    reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED ||
    isCreatedAction(reportAction) ||
    isWhisperActionTargetedToOthers(reportAction) ||
    (isMoneyRequestAction(reportAction) && !!report?.isWaitingOnBankAccount && originalMessage?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && !isSendingMoney)
    ) {
    continue;
    }

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

    If we go with the 2nd option, we can add a new test case for shouldReportActionBeVisible for MOVEDTRANSACTION.

  5. added
    External
    on Sep 15, 2025
  6. melvin-bot commented on Sep 15, 2025

    @melvin-bot
  7. changed the title [-]Expense - "moved this expense to your personal space" is missing sender, empty message on Reports[/-] [+][$250] Expense - "moved this expense to your personal space" is missing sender, empty message on Reports[/+] on Sep 15, 2025
  8. added
    Help Wanted
    on Sep 15, 2025
  9. melvin-bot commented on Sep 15, 2025

    @melvin-bot

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

  10. zanyrenney commented on Sep 15, 2025

    @zanyrenney
    Contributor
  11. 20 remaining items

  12. added
    Reviewing
    Weekly
    and removed
    Daily
    on Sep 29, 2025
  13. bernhardoj commented on Sep 29, 2025

    @bernhardoj
    Contributor

    PR is ready

    cc: @hungvu193

  14. added and removed
    Weekly
    on Oct 22, 2025
  15. melvin-bot commented on Oct 22, 2025

    @melvin-bot

    This issue has not been updated in over 15 days. @chuckdries, @hungvu193, @bernhardoj, @zanyrenney eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  16. hungvu193 commented on Oct 23, 2025

    @hungvu193
    Contributor

    Oh this is due for payment

    cc @zanyrenney

  17. zanyrenney commented on Oct 29, 2025

    @zanyrenney
    Contributor

    Payment summary

    $250 due to @hungvu193 via ND.
    $250 due to @bernhardoj via ND.

  18. bernhardoj commented on Oct 29, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  19. quinthar commented on Nov 2, 2025

    @quinthar
    Contributor

    $250 approved to @bernhardoj

  20. JmillsExpensify commented on Nov 3, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @hungvu193

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

Metadata

Metadata

Labels

BugExternalMonthlyReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions