Skip to content

[Due for payment 2025-05-14] [$250] Remove $XX.XX from the submitted and approved system messages #58650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garrettmknight opened this issue Mar 18, 2025 · 49 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@garrettmknight
Copy link
Contributor

garrettmknight commented Mar 18, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: N/A
Reproducible in staging?: N/A
Reproducible in production?: N/A
Email or phone of affected tester (no customers): N/A
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL: N/A
Issue reported by: @garrettmknight
Slack conversation (hyperlinked to channel name): #convert

Action Performed:

1.Submit a few expenses that total $50
2. Report totals $50, system message says ‘submitted $50’
3. Move another $50 expense to the Processing report
4. Report totals $100, report history only shows submitting $50
5. Approve the report

Expected Result:

We shouldn't be duplicating information about the report total when it already exists at the top of the report.

  • The submitted system message should simply read "Submitter submitted this report" if they manually submitted or "Submitter submitted this report via delay submission" if it was automatically submitted
  • The approved system message should also just read "Approver approved this report" if they manually approved or "Approver approved this report via workspace rules" if it was automatically approved

Let's update the system messages to this:

  • User submits a report manually: [Name] submitted
  • User submits a report via scheduled submit/delay submission: [Name] submitted via [workflow settings](link to workspace workflow settings help page)
  • User approves a report manually: [Name] approved
  • User approves a report via auto-approval: [Name] approved via [workspace rules](link to workspace rules settings help page)
  • User unapproves a report: [Name] unapproved

Actual Result:

The submitted and approved system messages include the report total, duplicating the information on the report.

Workaround:

Users can use the product, it's just confusing.

Platforms:

All

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021902157829644718864
  • Upwork Job ID: 1902157829644718864
  • Last Price Increase: 2025-03-19
  • Automatic offers:
    • FitseTLT | Contributor | 106734717
Issue OwnerCurrent Issue Owner: @Christinadobrzyn
@garrettmknight garrettmknight added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Mar 18, 2025
Copy link

melvin-bot bot commented Mar 18, 2025

Triggered auto assignment to @Christinadobrzyn (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.

@garrettmknight garrettmknight changed the title Remove $XX.XX from the submitted system message Remove $XX.XX from the submitted and approved system messages Mar 18, 2025
@FitseTLT
Copy link
Contributor

@garrettmknight What about unapproved system messages?

@garrettmknight
Copy link
Contributor Author

Good call, let's update those too - I also just tweaked the copy in the OP.

@FitseTLT
Copy link
Contributor

Proposal

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

Remove $XX.XX from the submitted and approved system messages

What is the root cause of that problem?

We add the amount for submitted and approved actions here

App/src/libs/ReportUtils.ts

Lines 5378 to 5403 in b0f5f9f

function getReportAutomaticallySubmittedMessage(
reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED> | ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED>,
report?: Report,
) {
return translateLocal('iou.automaticallySubmittedAmount', {formattedAmount: getFormattedAmount(reportAction, report)});
}
function getIOUSubmittedMessage(
reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED> | ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED_AND_CLOSED>,
report?: Report,
) {
return translateLocal('iou.submittedAmount', {formattedAmount: getFormattedAmount(reportAction, report)});
}
function getReportAutomaticallyApprovedMessage(reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.APPROVED>, report?: Report) {
return translateLocal('iou.automaticallyApprovedAmount', {amount: getFormattedAmount(reportAction, report)});
}
function getIOUUnapprovedMessage(reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.UNAPPROVED>, report?: Report) {
return translateLocal('iou.unapprovedAmount', {amount: getFormattedAmount(reportAction, report)});
}
function getIOUApprovedMessage(reportAction: ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.APPROVED>, report?: Report) {
return translateLocal('iou.approvedAmount', {amount: getFormattedAmount(reportAction, report)});
}

we use these functions to display the report actions and copy to clipboard and so on.
additionally we add amount for the system message in getIOUReportActionMessage here

App/src/libs/ReportUtils.ts

Lines 5515 to 5517 in b0f5f9f

case CONST.REPORT.ACTIONS.TYPE.APPROVED:
iouMessage = `approved ${amount}`;
break;

App/src/libs/ReportUtils.ts

Lines 5539 to 5541 in b0f5f9f

case CONST.REPORT.ACTIONS.TYPE.SUBMITTED:
iouMessage = translateLocal('iou.submittedAmount', {formattedAmount: amount});
break;

App/src/libs/ReportUtils.ts

Lines 5521 to 5523 in b0f5f9f

case CONST.REPORT.ACTIONS.TYPE.UNAPPROVED:
iouMessage = `unapproved ${amount}`;
break;

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

We can get the name from displayName of the reportAction.actorAccountID via getDisplayNameForParticipant and can give a fallback of the reportAction.person.text and pass as a param (similar to pay copy here) to new copies that align with the OP for their respective system messages.
We use these copies for the above functions

App/src/languages/en.ts

Lines 968 to 970 in b0f5f9f

submittedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `submitted ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
automaticallySubmittedAmount: ({formattedAmount}: RequestedAmountMessageParams) =>
`automatically submitted ${formattedAmount} via <a href="${CONST.DELAYED_SUBMISSION_HELP_URL}">delayed submission</a>`,

App/src/languages/en.ts

Lines 985 to 987 in b0f5f9f

automaticallyApprovedAmount: ({amount}: ApprovedAmountParams) =>
`automatically approved ${amount} via <a href="${CONST.CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL}">workspace rules</a>`,
approvedAmount: ({amount}: ApprovedAmountParams) => `approved ${amount}`,

For iou.automaticallySubmittedAmount and iou.automaticallyApprovedAmount we easily replace the copies to the new copy.

But for iou.submittedAmount and iou.approvedAmount we use them in other places as getIOUReportActionDisplayMessage which serve other purposes such as the copy to clipboard for money request actions (transaction thread report parent action) here

} else if (isMoneyRequestAction(reportAction)) {
const displayMessage = getIOUReportActionDisplayMessage(reportAction, transaction);
if (displayMessage === Parser.htmlToText(displayMessage)) {
Clipboard.setString(displayMessage);
} else {
setClipboardMessage(displayMessage);
}

which currently returns copies with amount and additional comment as submitted $12.00 for sdf so we might need the amount here so for this case and other cases we need them we can update the copies to handle both cases with and without amount or add a separate copy for these cases needed but we will need to confirm with the initial intention on the current issue.

and also remove the amount from approved and unapproved system message here (we can also consider updating it to use the approved/unapproved copy same as we do for submitted message) and update similar to the new copy

App/src/libs/ReportUtils.ts

Lines 5515 to 5517 in b0f5f9f

case CONST.REPORT.ACTIONS.TYPE.APPROVED:
iouMessage = `approved ${amount}`;
break;

App/src/libs/ReportUtils.ts

Lines 5521 to 5523 in b0f5f9f

case CONST.REPORT.ACTIONS.TYPE.UNAPPROVED:
iouMessage = `unapproved ${amount}`;
break;

Note: Updating this functions suffices to avoid showing the amount in these system messages but if we are going to update the reprotAction.message in getIOUReportActionMessage optimistically as above we will also need update BE (SUBMIT_REPORT APPROVE_MONEY_REQUEST unapprove) to create the action with the appropriate value consistent with these changes otherwise we can leave the changes of getIOUReportActionMessage and only update the way we display these system message in which case FE changes would be enough.

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

Test submit and approve actions to assert they create system messages with the appropriate message without amount if we are going to update the optimistic reportAction.message but if we don't we will not add tests as it will only be a copy change.

What alternative solutions did you explore? (Optional)

@Christinadobrzyn Christinadobrzyn added the External Added to denote the issue can be worked on by a contributor label Mar 19, 2025
@melvin-bot melvin-bot bot changed the title Remove $XX.XX from the submitted and approved system messages [$250] Remove $XX.XX from the submitted and approved system messages Mar 19, 2025
Copy link

melvin-bot bot commented Mar 19, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021902157829644718864

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 19, 2025
Copy link

melvin-bot bot commented Mar 19, 2025

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

@Christinadobrzyn
Copy link
Contributor

I think this can be external

@mananjadhav
Copy link
Collaborator

@FitseTLT's proposal is comprehensive. We'll need someone from the internal team to comment on the BE changes.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Mar 19, 2025

Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Pranavs09
Copy link

Pranavs09 commented Mar 19, 2025

Hi is there anyone on the team who can please make me understand. How these things are working. Most the problems I see I can workon them but when I open GitHub it always says assigned to someone. How can I get to work on this? and If this is not the product freelance can work on how come it is getting posted on upwork. @garrettmknight @MelvinBot

@trjExpensify
Copy link
Contributor

If an issue in the repo has the Help wanted label on it, you're free to put in a proposal following this guide.

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Mar 20, 2025

@srikarparsi can you please review this when you have a moment? TY!

@srikarparsi
Copy link
Contributor

Updating this functions suffices to avoid showing the amount in these system messages but if we are going to update the reprotAction.message in getIOUReportActionMessage optimistically as above we will also need update BE (SUBMIT_REPORT APPROVE_MONEY_REQUEST unapprove) to create the action with the appropriate value consistent with these changes otherwise we can leave the changes of getIOUReportActionMessage and only update the way we display these system message in which case FE changes would be enough.

@FitseTLT do you think you can explain what will happen if we only make changes to the copy and not getIOUReportActionMessage. In other words, what difference does updating getIOUReportActionMessage have vs updating getIOUUnapprovedMessage as one example.

And on another note, can we consolidate by having getIOUReportActionMessage call getIOUUnapprovedMessage?

On the backend, we will have to make changes to the action itself as well as the last message text.

@melvin-bot melvin-bot bot added the Overdue label Mar 21, 2025
@FitseTLT
Copy link
Contributor

Updating this functions suffices to avoid showing the amount in these system messages but if we are going to update the reprotAction.message in getIOUReportActionMessage optimistically as above we will also need update BE (SUBMIT_REPORT APPROVE_MONEY_REQUEST unapprove) to create the action with the appropriate value consistent with these changes otherwise we can leave the changes of getIOUReportActionMessage and only update the way we display these system message in which case FE changes would be enough.

@FitseTLT do you think you can explain what will happen if we only make changes to the copy and not getIOUReportActionMessage. In other words, what difference does updating getIOUReportActionMessage have vs updating getIOUUnapprovedMessage as one example.

And on another note, can we consolidate by having getIOUReportActionMessage call getIOUUnapprovedMessage?

On the backend, we will have to make changes to the action itself as well as the last message text.

@srikarparsi Ignore what I have said before and on a second thought, I think we shouldn't make BE changes. We only use reportAction.message to display a report action for cases we haven't handled specifically. But for the report actions in this issue we all specifically control how we display the report actions via the functions getIOUSubmittedMessage getReportAutomaticallySubmittedMessage and so on. So I think we should updated those functions and linked copies to achieve the target of the issue. Having the amount inside the reportaction.message wouldn't hurt as we already control how display the actions in FE. WDYT

@mananjadhav
Copy link
Collaborator

Not overdue, solution being discussed

@melvin-bot melvin-bot bot removed the Overdue label Mar 21, 2025
Copy link

melvin-bot bot commented Mar 25, 2025

@mananjadhav Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Mar 25, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 1, 2025
@Christinadobrzyn
Copy link
Contributor

Just checking @FitseTLT are we still working on the revert?

@Christinadobrzyn Christinadobrzyn added Daily KSv2 and removed Weekly KSv2 labels May 6, 2025
@FitseTLT
Copy link
Contributor

FitseTLT commented May 6, 2025

just got merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 7, 2025
@melvin-bot melvin-bot bot changed the title [$250] Remove $XX.XX from the submitted and approved system messages [Due for payment 2025-05-14] [$250] Remove $XX.XX from the submitted and approved system messages May 7, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented May 7, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.41-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-05-14. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented May 7, 2025

@mananjadhav @Christinadobrzyn @mananjadhav The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@mananjadhav
Copy link
Collaborator

Once reverted, we can pay out.

This was reverted and on production for a few days. @garrettmknight I think this can now be paid out.

@Christinadobrzyn
Copy link
Contributor

Thanks @mananjadhav do we need a regression test?

@Christinadobrzyn Christinadobrzyn added Daily KSv2 and removed Weekly KSv2 labels May 13, 2025
@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels May 14, 2025
@mananjadhav
Copy link
Collaborator

@Christinadobrzyn, No we decided to revert this PR. So no regression test and checklist needed. Just needs to be paid out.

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented May 15, 2025

Thanks @mananjadhav since the PR reverted I think it's a 50% penalty.

Payment summary here - #58650 (comment)

Please make sure to request payment in ND. Closing this out!

@FitseTLT
Copy link
Contributor

FitseTLT commented May 15, 2025

Thanks @mananjadhav since the PR reverted I think it's a 50% penalty.

Payment summary here - #58650 (comment)

No penalities it is a change of plan no any regression read #58650 (comment) 😄 @Christinadobrzyn

@Christinadobrzyn
Copy link
Contributor

Ah sorry! Thank you! Paying it out in full. Updating the payment summary - #58650 (comment)

@mananjadhav
Copy link
Collaborator

Discussed with @Christinadobrzyn on DM and posting it here as well. The revert wasn’t because of a bug but change in requirement and that it’ll be handled as a larger change in another issue.

@garrettmknight
Copy link
Contributor Author

$250 approved for @mananjadhav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

7 participants