Skip to content

[$250] Expense - After paying user via "+ > Pay" and changing workspace, expense details disappear #65322

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: https://expensify.testrail.io/index.php?/tests/view/6414864
Email or phone of affected tester (no customers): siojsduhsbsuid1@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • User has at least one workspace.
  1. Go to staging.expensify.com
  2. Open 1:1 DM.
  3. Click + > Pay user.
  4. Enter amount > Next.
  5. Click Pay elsewhere.
  6. Open the expense report.
  7. Click More > Change workspace.
  8. Select workspace.

Expected Result:

After changing workspace, transaction details will not disappear.

Actual Result:

After changing workspace, transaction details disappear and only report total is shown.

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/~021947447670561711345
  • Upwork Job ID: 1947447670561711345
  • Last Price Increase: 2025-08-12
Issue OwnerCurrent Issue Owner: @QichenZhu

Activity

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

    @melvin-bot

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

    @bernhardoj
    Contributor

    Proposal

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

    When moving send money report to workspace, the expense details don't show.

    What is the root cause of that problem?

    After we move it to a workspace, transactionThreadReport is undefined.

    <OfflineWithFeedback pendingAction={action?.pendingAction}>
    {!isEmptyObject(transactionThreadReport?.reportID) ? (
    <>
    <MoneyReportView
    report={report}
    policy={policy}
    isCombinedReport
    pendingAction={action?.pendingAction}
    shouldShowTotal={transaction ? transactionCurrency !== report?.currency : false}
    shouldHideThreadDividerLine={false}
    />
    <ShowContextMenuContext.Provider value={contextMenuValue}>
    <View>
    <MoneyRequestView
    report={transactionThreadReport}
    shouldShowAnimatedBackground={false}
    />
    {renderThreadDivider}
    </View>
    </ShowContextMenuContext.Provider>
    </>
    ) : (
    <MoneyReportView
    report={report}
    policy={policy}
    pendingAction={action?.pendingAction}
    shouldHideThreadDividerLine={shouldHideThreadDividerLine}
    />
    )}
    </OfflineWithFeedback>

    It's because the PAY action which contains the information is excluded from the action list, so getOneTransactionThreadReportID returns undefined.

    for (const action of reportActionsArray) {
    // If the original message is a 'pay' IOU, it shouldn't be added to the transaction count.
    // However, it is excluded from the matching function in order to display it properly, so we need to compare the type here.
    if (!isIOUActionMatchingTransactionList(action, reportTransactionIDs, true) || getOriginalMessage(action)?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) {
    // eslint-disable-next-line no-continue
    continue;
    }

    We already have an exception for send money report here,

    const sendMoneyFlowID = getSendMoneyFlowOneTransactionThreadID(reportActions, chatReport);
    if (sendMoneyFlowID) {
    return sendMoneyFlowID;
    }

    however, it only works if it's an IOU report.

    const {type, chatType, parentReportID, parentReportActionID} = chatReport;
    // ...and can only be triggered on DM chats
    const isDM = type === CONST.REPORT.TYPE.CHAT && !chatType && !(parentReportID && parentReportActionID);
    return isFirstActionPay && isDM ? iouActions.at(0)?.childReportID : undefined;
    }

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

    Since it's possible for the send money report to be in workspace report too, we need to remove the isDM check.

    // ...and can only be triggered on DM chats
    const isDM = type === CONST.REPORT.TYPE.CHAT && !chatType && !(parentReportID && parentReportActionID);
    return isFirstActionPay && isDM ? iouActions.at(0)?.childReportID : undefined;

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

    We need to update getSendMoneyFlowOneTransactionThreadID existing test so it returns the childReportID for both IOU and expense report.

    What alternative solutions did you explore? (Optional)

    We can hide the change workspace for send money report. We can do the same check in getSendMoneyFlowOneTransactionThreadID.

    const iouActions = Object.values(actions ?? {}).filter(isMoneyRequestAction);
    // sendMoneyFlow has only one IOU action...
    if (iouActions.length !== 1) {
    return undefined;
    }
    // ...which is 'pay'...
    const isFirstActionPay = getOriginalMessage(iouActions.at(0))?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY;

    function canEditReportPolicy(report: OnyxEntry<Report>, reportPolicy: OnyxEntry<Policy>, reportActions): boolean {
        ...
        if (isIOUType) {
            let isSendMoney = false;
            const iouActions = Object.values(reportActions ?? {}).filter(isMoneyRequestAction);
            
            if (iouActions.length === 1) {
                const isFirstActionPay = getOriginalMessage(iouActions.at(0))?.type === CONST.IOU.REPORT_ACTION_TYPE.PAY;
                isSendMoney = isFirstActionPay;
            }
    
            return (isOpen || isSubmitted || isReimbursed) && !isSendMoney;
        }
    
  4. melvin-bot commented on Jul 7, 2025

    @melvin-bot

    @strepanier03 Huh... This is 4 days overdue. Who can take care of this?

  5. melvin-bot commented on Jul 9, 2025

    @melvin-bot

    @strepanier03 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  6. melvin-bot commented on Jul 11, 2025

    @melvin-bot

    @strepanier03 Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  7. melvin-bot commented on Jul 15, 2025

    @melvin-bot

    @strepanier03 12 days overdue. Walking. Toward. The. Light...

  8. strepanier03 commented on Jul 16, 2025

    @strepanier03
    Contributor

    Will prioritize tomorrow.

  9. melvin-bot commented on Jul 16, 2025

    @melvin-bot

    @strepanier03 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  10. melvin-bot commented on Jul 21, 2025

    @melvin-bot

    @strepanier03 Huh... This is 4 days overdue. Who can take care of this?

  11. 14 remaining items

  12. melvin-bot commented on Jul 30, 2025

    @melvin-bot

    @strepanier03 @QichenZhu this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  13. strepanier03 commented on Jul 31, 2025

    @strepanier03
    Contributor

    Started a discussion on expected behavior here.

  14. melvin-bot commented on Jul 31, 2025

    @melvin-bot

    @QichenZhu Huh... This is 4 days overdue. Who can take care of this?

  15. melvin-bot commented on Aug 5, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  16. melvin-bot commented on Aug 6, 2025

    @melvin-bot

    @QichenZhu 10 days overdue. Is anyone even seeing these? Hello?

  17. QichenZhu commented on Aug 7, 2025

    @QichenZhu
    Contributor

    Started a discussion on expected behavior here.

    Hi @strepanier03, any news from the team? I don't have access to that conv.

  18. melvin-bot commented on Aug 12, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  19. melvin-bot commented on Aug 12, 2025

    @melvin-bot

    @QichenZhu Huh... This is 4 days overdue. Who can take care of this?

  20. QichenZhu commented on Aug 18, 2025

    @QichenZhu
    Contributor

    Not overdue. Still waiting on the team's conclusion.

  21. strepanier03 commented on Aug 18, 2025

    @strepanier03
    Contributor

    Sorry, this one fell through the cracks. I went back and read through the discussion and we can close this now. We've decided not to spend more time on this and to let the current behavior be as is.

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

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions