Skip to content

[HOLD for payment 2024-05-22] Hold expense - Thread header for system message is different from the actual system message #41202

Closed

Description

@izarutskaya

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: 1.4.67-0
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Submit two expenses to a user.
  3. Go to transaction thread of any expense.
  4. Click 3-dot menu > Hold expense.
  5. Enter a reason and save it.
  6. Right click on the hold expense system message > Reply in thread.

Expected Result:

The thread header message will be consistent with the system message.

Actual Result:

The thread header shows "held this money request", while the system message is "held this expense".

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6464774_1714364776428.bandicam_2024-04-29_12-23-13-201.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01de18ac2a60287419
  • Upwork Job ID: 1786066158847115264
  • Last Price Increase: 2024-05-02
Issue OwnerCurrent Issue Owner: @miljakljajic

Activity

  1. added
    Daily
    Bug
    on Apr 29, 2024
  2. melvin-bot commented on Apr 29, 2024

    @melvin-bot

    Triggered auto assignment to @miljakljajic (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. izarutskaya commented on Apr 29, 2024

    @izarutskaya
    Author

    We think this issue might be related to the #collect project.

  4. dragnoir commented on Apr 29, 2024

    @dragnoir
    Contributor

    BE issue.

  5. bernhardoj commented on Apr 30, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The thread header title for hold system message is different than the message.

    What is the root cause of that problem?

    For a thread, the header title will take the parent action message. The hold system message is "held this money request" as shown below
    image

    But when we render the hold system message, we render a custom message, that is "held this expense".

    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) {
    children = <ReportActionItemBasicMessage message={translate('iou.heldExpense')} />;
    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD_COMMENT) {
    children = <ReportActionItemBasicMessage message={action.message?.[0]?.text ?? ''} />;
    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) {
    children = <ReportActionItemBasicMessage message={translate('iou.unheldExpense')} />;

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

    We have 2 options,

    First, in ReportUtils.getReportName, if it's a hold action, then we show the custom message ("held this expense").

    App/src/libs/ReportUtils.ts

    Lines 3057 to 3092 in e0c12a5

    if (isChatThread(report)) {
    if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isTransactionThread(parentReportAction)) {
    formattedName = getTransactionReportName(parentReportAction);
    if (isArchivedRoom(report)) {
    formattedName += ` (${Localize.translateLocal('common.archived')})`;
    }
    return formattedName;
    }
    if (parentReportAction?.message?.[0]?.isDeletedParentAction) {
    return Localize.translateLocal('parentReportAction.deletedMessage');
    }
    const isAttachment = ReportActionsUtils.isReportActionAttachment(!isEmptyObject(parentReportAction) ? parentReportAction : null);
    const parentReportActionMessage = getReportActionMessage(parentReportAction, report?.parentReportID).replace(/(\r\n|\n|\r)/gm, ' ');
    if (isAttachment && parentReportActionMessage) {
    return `[${Localize.translateLocal('common.attachment')}]`;
    }
    if (
    parentReportAction?.message?.[0]?.moderationDecision?.decision === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE ||
    parentReportAction?.message?.[0]?.moderationDecision?.decision === CONST.MODERATION.MODERATOR_DECISION_HIDDEN ||
    parentReportAction?.message?.[0]?.moderationDecision?.decision === CONST.MODERATION.MODERATOR_DECISION_PENDING_REMOVE
    ) {
    return Localize.translateLocal('parentReportAction.hiddenMessage');
    }
    if (isAdminRoom(report) || isUserCreatedPolicyRoom(report)) {
    return getAdminRoomInvitedParticipants(parentReportAction, parentReportActionMessage);
    }
    if (parentReportActionMessage && isArchivedRoom(report)) {
    return `${parentReportActionMessage} (${Localize.translateLocal('common.archived')})`;
    }
    if (ReportActionsUtils.isModifiedExpenseAction(parentReportAction)) {
    return ModifiedExpenseMessage.getForReportAction(report?.reportID, parentReportAction);
    }
    return parentReportActionMessage;
    }

    if (parentReportAction.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) {
        return Localize.translateLocal('iou.heldExpense')
    }
    

    OR

    Show the original message of the hold action, just like what we did for HOLD_COMMENT.

    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) {
    children = <ReportActionItemBasicMessage message={translate('iou.heldExpense')} />;
    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD_COMMENT) {
    children = <ReportActionItemBasicMessage message={action.message?.[0]?.text ?? ''} />;
    } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) {
    children = <ReportActionItemBasicMessage message={translate('iou.unheldExpense')} />;

    Depends on the team which message to use.

    we need to fix for unhold action too

  6. added
    Internal
    on May 2, 2024
  7. melvin-bot commented on May 2, 2024

    @melvin-bot
  8. melvin-bot commented on May 2, 2024

    @melvin-bot

    Triggered auto assignment to Contributor Plus for review of internal employee PR - @Ollyws (Internal)

  9. 28 remaining items

  10. Ollyws commented on May 22, 2024

    @Ollyws
    Contributor

    Requested payment in ND for this one.

  11. Ollyws commented on May 23, 2024

    @Ollyws
    Contributor

    BugZero Checklist:

    • The PR that introduced the bug has been identified. Link to the PR:

    #38884

    • 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:

    #38884 (comment)

    • A discussion in #expensify-bugs 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:

    N/A

    • Determine if we should create a regression test for this bug.

    Yes

    • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

    Regression Test Proposal

    1. Submit a new expense to anyone
    2. Open the transaction thread and put it on hold
    3. Unhold the expense
    4. There is currently a BE bug, so refresh/reopen the transaction thread
    5. Right-click or long-press the hold/unhold system message
    6. Choose Reply in thread
    7. Verify the thread title for hold system message is "held this expense"
    8. Verify the thread title for unhold system message is "unheld this expense"
    

    Do we agree 👍 or 👎

  12. neil-marcellini commented on May 23, 2024

    @neil-marcellini
    Contributor

    I don't think we really need a regression test for this one, at least not until we fix the backend bug you mentioned.

  13. miljakljajic commented on May 27, 2024

    @miljakljajic
    Contributor

    Payment summary: @Ollyws is owed 500 USD for their work on this issue

  14. miljakljajic commented on May 27, 2024

    @miljakljajic
    Contributor

    Bernard has been paid

  15. Ollyws commented on May 27, 2024

    @Ollyws
    Contributor

    Payment summary: @Ollyws is owed 500 USD for their work on this issue

    @miljakljajic Was this one a $500 not $250?

  16. JmillsExpensify commented on May 28, 2024

    @JmillsExpensify
    Contributor

    Reached out to Milja via DM to confirm.

  17. miljakljajic commented on Jun 5, 2024

    @miljakljajic
    Contributor

    Apologies, this should be 250! Updated summary:

    Payment summary: @Ollyws is owed 250 USD for their work on this issue

  18. miljakljajic commented on Jun 5, 2024

    @miljakljajic
    Contributor

    I will request a refund from Bernard via upwork

  19. bernhardoj commented on Jun 5, 2024

    @bernhardoj
    Contributor

    I think I get paid correctly
    image

  20. JmillsExpensify commented on Jun 5, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @Ollyws

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyInternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions