-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2024-02-01] [$500] Bug: description instead of merchant being used for expense room titles #34029
Comments
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The expense room title changes to use the description instead of the merchant What is the root cause of that problem?In here, we're using the transaction description in the What changes do you think we should make in order to solve the problem?Remove the Here, it can be something like
We should have the confirmation here to determine exact implementation because it's not clear yet from the OP. If we only want this behavior in the room title, we can pass in a flag to What alternative solutions did you explore? (Optional)There seems to be a bug in I believe this is affecting other places that use
So that if the |
ProposalPlease re-state the problem that we are trying to solve in this issue.The transaction thread title does not prioritize the merchant over the description for Expense requests What is the root cause of that problem?We are using this function for building the Transaction Report title: Lines 1987 to 2015 in 9b74851
It uses only Lines 2011 to 2014 in 9b74851
What changes do you think we should make in order to solve the problem?If the transaction belongs to an expense report, we should prioritize using the merchant instead of comment: const transactionDetails = getTransactionDetails(transaction);
const isEmptyMerchant = !transactionDetails?.merchant || transactionDetails?.merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;
const comment = TransactionUtils.isFromExpenseReport(transaction) && !isEmptyMerchant ? transactionDetails?.merchant : transactionDetails?.comment;
return Localize.translateLocal(ReportActionsUtils.isSentMoneyReportAction(reportAction) ? 'iou.threadSentMoneyReportName' : 'iou.threadRequestReportName', {
formattedAmount: CurrencyUtils.convertToDisplayString(transactionDetails?.amount ?? 0, transactionDetails?.currency, TransactionUtils.isDistanceRequest(transaction)) ?? '',
comment: comment ?? '',
}); For this, we also need to move the function isFromExpenseReport(transaction: Transaction): boolean {
const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`] ?? null;
return parentReport?.type === CONST.REPORT.TYPE.EXPENSE;
}
function areRequiredFieldsEmpty(transaction: Transaction): boolean {
return (isFromExpenseReport(transaction) && isMerchantMissing(transaction)) || isAmountMissing(transaction) || isCreatedMissing(transaction);
} App/src/libs/TransactionUtils.ts Lines 158 to 162 in 82b76c1
What alternative solutions did you explore? (Optional)If we want to prioritize the merchant for every transaction, not just the ones that belong to the Expense report, we should plainly use: const transactionDetails = getTransactionDetails(transaction);
const isEmptyMerchant = !transactionDetails?.merchant || transactionDetails?.merchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;
const comment = !isEmptyMerchant ? transactionDetails?.merchant : transactionDetails?.comment;
return Localize.translateLocal(ReportActionsUtils.isSentMoneyReportAction(reportAction) ? 'iou.threadSentMoneyReportName' : 'iou.threadRequestReportName', {
formattedAmount: CurrencyUtils.convertToDisplayString(transactionDetails?.amount ?? 0, transactionDetails?.currency, TransactionUtils.isDistanceRequest(transaction)) ?? '',
comment: comment ?? '',
}); Note: we shouldn't use |
Currently the @dylanexpensify @shawnborton can you clarify the expectation here:
|
ProposalUpdated proposal #34029 (comment) |
Proposal updated to add example code changes |
@sobitneupane, @dylanexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@dylanexpensify @shawnborton Just to clarify, are we aiming to display the merchant if it's available, and if not, show the description? Pseudocode:
|
Yup, that's my understanding. |
Where else do we use this pattern except room title? Can you please add more details. |
What other transaction(other than that of Expense report) are we talking about in the alternative solution? And how will they be affected if we go with alternative solution. |
The IOU (1:1 and split) transactions of any type.
We will show the merchant if it's present. Otherwise – show the description. For any transaction, regardless of its type (1:1, split, expense (workspace)). |
Proposal updated to additionally address an existing bug with |
@sobitneupane it's the But I do think all those places should be consistent, I add it just in case there're places that we don't want it. But I don't find any for now. |
Nice! @sobitneupane to review! |
Yep, agreed. Merchant > Description > Blank! |
Thanks for the proposal @paultsimura and @dukenv0307 Both of the proposals are very similar. Looking at the edit history, both the proposals were incomplete when initially posted. Please try to post a complete proposal. Approach followed in both proposals is same (from the initial proposal) and implementation is not much different. I think it's good idea to make use of existing function. Let's go with @dukenv0307's proposal (it was initially posted proposal with correct RCA and approach). Let's solve the issue in 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Nice! @sobitneupane let's get it! |
bump @sobitneupane |
I am reviewing the PR. The changes are looking good. It should be ready for final review today. |
How's this going @sobitneupane |
PR merged. Waiting for it to deploy in production. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.31-7 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 2024-02-01. 🎊 For reference, here are some details about the assignees on this issue:
|
payment coming up! |
Payment summary:
Please request! |
@sobitneupane can you complete checklist? Payment sent @dukenv0307 |
bump @sobitneupane |
@dylanexpensify I am not sure if reviewer checklist is valid here. The code was introduced first by this #34216 PR as per the need back then. I think it is more of a feature request than bug. |
Regression Test Proposal:
Do we agree 👍 or 👎 |
$500 approved for @sobitneupane based on this summary. |
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: 1.4.15-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C03U7DCU4/p1704382128969099
Action Performed:
Expected Result:
The description is saved and room title doesn't change
Actual Result:
The expense room title changes to use the description instead of the merchant
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: