Skip to content
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

[Due for payment 2025-03-21] [$250] Expense - Saving multiline description with mark down with no edit triggers system message #43403

Open
4 of 6 tasks
izarutskaya opened this issue Jun 10, 2024 · 79 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Jun 10, 2024

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.81-1
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. Go to workspace chat.
  3. Submit an expense to workspace chat containing multiline description with mark down on each line.
    Example:
  • hello *
  • hellloo *
  1. Go to transaction thread.
  2. Wait for the expense to be completely created (sometimes the expense is created but not sent).
  3. Click on the description.
  4. Without changing the description, click Save.

Expected Result:

No system message for description edit will show up because no edit is made to the description.

Actual Result:

System message for description edit shows up when no edit is made to the description.
When repeating Step 6 and 7, the transaction thread turns blank with the error "There was an error loading more messages."

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

Bug6508340_1718036856778.bandicam_2024-06-11_00-22-35-147.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018d19307f19622d14
  • Upwork Job ID: 1800742519908507814
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • mkhutornyi | Reviewer | 102884170
    • dominictb | Contributor | 102884171
Issue OwnerCurrent Issue Owner: @kadiealexander
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

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

@izarutskaya
Copy link
Author

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jun 10, 2024

Proposal

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

Expense - Saving multiline description with mark down with no edit triggers system message

What is the root cause of that problem?

The backend returns *b*\r\n*b*, the \r is counted as extra character which isn't present in the form value, and as a result, the check below doesn't become true, so we don't return early and update description api is called.

const newComment = value.moneyRequestComment.trim();
// Only update comment if it has changed
if (newComment === currentDescription) {
navigateBack();
return;
}

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

To make the currentDescription same as the form value we need to first use parser.replace and then parser.htmlToMarkdown for currentDescription.

    const currentDescription =
        isEditingSplitBill && !lodashIsEmpty(splitDraftTransaction)
            ? splitDraftTransaction?.comment.comment ?? ''
            : parser.htmlToMarkdown(parser.replace(transaction?.comment.comment ?? '')).trim();

We should also check for similar bug in other similar components.

What alternative solutions did you explore? (Optional)

We can replace \r in currentDescription with "" and then compare.

@dominictb
Copy link
Contributor

Proposal

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

System message for description edit shows up when no edit is made to the description.
When repeating Step 6 and 7, the transaction thread turns blank with the error "There was an error loading more messages."

What is the root cause of that problem?

The description that is returned by back-end includes \r character which doesn't exist in value of input. It leads this check here isn't true and then the update API is called that makes the system message appears.

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

  1. As other description field, we should accept to store the description of money request as html instead of markdown. Update here to convert the description to html before saving
comment: ReportUtils.getParsedComment(comment),

We need back-end change to accept the description of money request can be stored as htm.

  1. Update the default value here to parser.htmlToMarkdown(currentDescription) and update the condition here to newComment === parser.htmlToMarkdown(currentDescription). This is the same way as we do for other description field like task description field, room description field,...

What alternative solutions did you explore? (Optional)

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Jun 12, 2024
@melvin-bot melvin-bot bot changed the title Expense - Saving multiline description with mark down with no edit triggers system message [$250] Expense - Saving multiline description with mark down with no edit triggers system message Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

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

@mkhutornyi
Copy link
Contributor

reviewing proposals

@mkhutornyi
Copy link
Contributor

If this issue doesn't happen on other multiline fields like task description, room description, we should apply same logic to be consistent.

@kadiealexander
Copy link
Contributor

@mkhutornyi is anything wrong with the current proposals?

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
Copy link

melvin-bot bot commented Jun 17, 2024

@kadiealexander, @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mkhutornyi
Copy link
Contributor

@dominictb thanks for the proposal.

We need back-end change to accept the description of money request can be stored as htm.

Is backend already doing this on task description and room description?

@melvin-bot melvin-bot bot removed the Overdue label Jun 17, 2024
@dominictb
Copy link
Contributor

@mkhutornyi Yes.

Copy link

melvin-bot bot commented Jun 19, 2024

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

@mkhutornyi
Copy link
Contributor

@dominictb's proposal looks good to me.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 20, 2024

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

Copy link

melvin-bot bot commented Jun 24, 2024

@MariaHCD @kadiealexander @mkhutornyi this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

@MariaHCD, @kadiealexander, @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mountiny
Copy link
Contributor

@dominictb sorry this has been a while, can you add description of the issue you are seeing now?

@dominictb
Copy link
Contributor

dominictb commented Jan 16, 2025

@mountiny We all agreed to update UpdateMoneyRequestDescription API to accept and return HTML description (or comment) #43403 (comment) (instead of markdown as currently) to align with other flows like EditTask or UpdateRoomDescription. It was completed by you #43403 (comment). So now the money request's description should always be HTML.

We need to do the same for RequestMoney API as well because it currently only accepts and returns markdown description (comment).

@mountiny
Copy link
Contributor

Made a PR https://github.com/Expensify/Web-Expensify/pull/45170

@dominictb
Copy link
Contributor

@mountiny How's the PR going?

@mountiny
Copy link
Contributor

mountiny commented Feb 6, 2025

@dominictb the PR was merged and deployed, can you test now?

@dominictb
Copy link
Contributor

dominictb commented Feb 6, 2025

@mountiny I just tested all the expense flows and found 1 problem. Same reason as #43403 (comment). We need to make all the expense creation APIs to accept HTML description like you did with UpdateMoneyRequestDescription and RequestMoney. These are the endpoints that need updating that I've found so far:

  • TrackExpense
  • ConvertTrackedExpenseToRequest
  • AddTrackedExpenseToPolicy
  • ShareTrackedExpense
  • CategorizeTrackedExpense

Correct me if I missed any.

@mountiny
Copy link
Contributor

mountiny commented Feb 6, 2025

In addition to those you have mentioned above, we have (not all might be used in the App right now):

  • CreateDistanceRequest
  • UpdateDistanceRequest
  • SplitBill
  • SplitBillAndOpenReport
  • StartSplitBill
  • CompleteSplitBill
  • SendInvoice

Can you make sure to update the code there accordingly too?

@mountiny
Copy link
Contributor

mountiny commented Feb 6, 2025

Backedn Pr is up

@dominictb
Copy link
Contributor

@mountiny Notify us when they are done.

@mountiny
Copy link
Contributor

@dominictb deployed

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Mar 10, 2025
Copy link

melvin-bot bot commented Mar 10, 2025

This issue has not been updated in over 15 days. @mountiny, @kadiealexander, @mkhutornyi, @dominictb 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!

@dominictb
Copy link
Contributor

PR was merged.

@mountiny
Copy link
Contributor

@dominictb Please be on a look out for any deploy blockers related to this as it was a large change

@akinwale
Copy link
Contributor

Deployed to production 2025-03-12. Payment due 2025-03-19.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 Weekly KSv2 labels Mar 13, 2025
@melvin-bot melvin-bot bot changed the title [$250] Expense - Saving multiline description with mark down with no edit triggers system message [Due for payment 2025-03-21] [$250] Expense - Saving multiline description with mark down with no edit triggers system message Mar 14, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 14, 2025
Copy link

melvin-bot bot commented Mar 14, 2025

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

Copy link

melvin-bot bot commented Mar 14, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.12-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 2025-03-21. 🎊

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

Copy link

melvin-bot bot commented Mar 14, 2025

@dominictb @kadiealexander @dominictb 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]

@akinwale
Copy link
Contributor

@kadiealexander I took over as C+ on this issue for the PR review.

@mountiny mountiny assigned akinwale and unassigned mkhutornyi Mar 14, 2025
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. External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests