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

[HOLD for payment 2024-06-03] [$250] Room - Multiline name set for URL is shown in different format for room and task description #39496

Closed
2 of 6 tasks
lanitochka17 opened this issue Apr 3, 2024 · 36 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

@lanitochka17
Copy link

lanitochka17 commented Apr 3, 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.59
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:
Slack conversation:

Action Performed:

  1. Launch app
  2. Tap on room chat
  3. Tap on room header
  4. Tap description
  5. Enter s.com and save
  6. Tap description again
  7. Set url an multiline name and save
  8. Tap plus icon --- assign task
  9. Enter title
  10. Enter description as s.com and save
  11. Tap next and confirm task
  12. Open task
  13. Tap description
  14. Set url an multiline name and save

Expected Result:

System message for multiline name set for URL must not be shown in different format for room and task description inconsistently.

Actual Result:

System message for multiline name set for URL is shown in different format for room and task description

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

Add any screenshot/video evidence

Bug6435854_1712079389764.TX_am.mp4

Bug6435854_1712079389754!Screenshot_2024-04-02-22-03-08-265_com android chrome-edit

Bug6435854_1712079389760!Screenshot_2024-04-02-22-02-08-787_com android chrome-edit

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0120eebece9f86310e
  • Upwork Job ID: 1775676813947215872
  • Last Price Increase: 2024-04-11
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 0
    • bernhardoj | Contributor | 0
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 3, 2024
Copy link

melvin-bot bot commented Apr 3, 2024

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@lanitochka17
Copy link
Author

@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 3, 2024

Proposal

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

The task description update message doesn't render the markdown which is different with room description.

What is the root cause of that problem?

For room description update message, the message contains a HTML of the markdown,

<muted-text>set the room description to: <a href="https://google.com" target="_blank" rel="noreferrer noopener">multi<br />line</a></muted-text>
image

but for task update description, even when we use markdown, the text doesn't contains the HTML representation of the MD.

updated the description to [multi
link](google.com)
image

So, when we try to render it, it just shows as plain text.

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

I think we can fix it on the BE by returning the HTML representation of the MD for task description update message too, but in case we want to handle it in FE, we can do it using ExpensiMark.

const message = TaskUtils.getTaskReportActionMessage(action);
return (
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.breakWord, styles.preWrap]}>
{message.html ? <RenderHTML html={`<muted-text>${message.html}</muted-text>`} /> : <Text style={[styles.chatItemMessage, styles.colorMuted]}>{message.text}</Text>}
</View>

const parser = new ExpensiMark();

<RenderHTML html={`<muted-text>${parser.replace(message.html)}</muted-text>`} />

What alternative solutions did you explore? (Optional)

Convert the description to HTML optimistically and send it to the BE.
We parse the description changelog here.

html: changelog,

html: getParsedComment(changelog),

The changelog can be a title or description changelog, so maybe we can conditionally parse it only when it's a description update.

And then parse the description value here that will be sent to the BE.

const reportDescription = (description ?? report.description ?? '').trim();

const reportDescription = ReportUtils.getParsedComment((description ?? report.description ?? '').trim());

Then, we need to replace shouldParseTitle with shouldRenderAsHTML because we already parsed the description so we don't want to parse it again.

<MenuItemWithTopDescription
shouldParseTitle
description={translate('task.description')}
title={report.description ?? ''}

We also don't need the parser.replace here anymore.

defaultValue={parser.htmlToMarkdown((report && parser.replace(report?.description ?? '')) || '')}

And last, when comparing the value here on submitting,

const submit = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.EDIT_TASK_FORM>) => {
if (parser.htmlToMarkdown(parser.replace(values.description)) !== parser.htmlToMarkdown(parser.replace(report?.description ?? '')) && !isEmptyObject(report)) {
// Set the description of the report in the store and then call EditTask API
// to update the description of the report on the server
Task.editTask(report, {description: values.description});

we should update it to,

if (values.description !== parser.htmlToMarkdown(report?.description ?? '') && !isEmptyObject(report)) {

No need to convert values.description to HTML and then to markdown because values.description is a markdown already.

I just realized this is what we did for the room description

const parsedDescription = ReportUtils.getParsedComment(newValue);

const [description, setDescription] = useState(() => parser.htmlToMarkdown(report?.description ?? ''));

@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 4, 2024
@melvin-bot melvin-bot bot changed the title Room - Multiline name set for URL is shown in different format for room and task description [$500] Room - Multiline name set for URL is shown in different format for room and task description Apr 4, 2024
Copy link

melvin-bot bot commented Apr 4, 2024

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

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

melvin-bot bot commented Apr 4, 2024

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

@bfitzexpensify bfitzexpensify changed the title [$500] Room - Multiline name set for URL is shown in different format for room and task description [$250] Room - Multiline name set for URL is shown in different format for room and task description Apr 4, 2024
Copy link

melvin-bot bot commented Apr 4, 2024

Upwork job price has been updated to $250

@bfitzexpensify
Copy link
Contributor

Proposal from @bernhardoj ready for review @abdulrahuman5196

@melvin-bot melvin-bot bot added the Overdue label Apr 8, 2024
@abdulrahuman5196
Copy link
Contributor

Hi, Will check on the proposal today.

@melvin-bot melvin-bot bot removed the Overdue label Apr 8, 2024
@abdulrahuman5196
Copy link
Contributor

Checking now

@abdulrahuman5196
Copy link
Contributor

@bernhardoj Even in the optimistic message(offline) I am seeing the same issue. I think regardless of backend fix we might need a FE fix as well.

But I tried your fix for doing the parser replace, but didn't workout for me. Could you kindly check and update proposal.

@bernhardoj
Copy link
Contributor

It works fine for me.

Screen.Recording.2024-04-10.at.10.08.41.mov

Btw, I just updated my proposal to include another solution that needs more changes but I think is better.

Copy link

melvin-bot bot commented Apr 11, 2024

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

@abdulrahuman5196
Copy link
Contributor

Checking now

@abdulrahuman5196
Copy link
Contributor

@bernhardoj 's proposal here #39496 (comment) looks good and works well.

And regarding the alternate solution, that change would almost make the description as complex as a comment. So I think at this point the proposed solution looks good keeping the description simple and effective. But anyways if internal engineer feels different, feel free to go with alternate solution.

🎀 👀 🎀
C+ Reviewed

Copy link

melvin-bot bot commented Apr 12, 2024

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

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

melvin-bot bot commented Apr 12, 2024

📣 @abdulrahuman5196 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented May 18, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels May 18, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 27, 2024
@melvin-bot melvin-bot bot changed the title [$250] Room - Multiline name set for URL is shown in different format for room and task description [HOLD for payment 2024-06-03] [$250] Room - Multiline name set for URL is shown in different format for room and task description May 27, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 27, 2024
Copy link

melvin-bot bot commented May 27, 2024

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

Copy link

melvin-bot bot commented May 27, 2024

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

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

Copy link

melvin-bot bot commented May 27, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] 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.
  • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@bfitzexpensify bfitzexpensify removed their assignment May 30, 2024
@bfitzexpensify bfitzexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 30, 2024
@bfitzexpensify
Copy link
Contributor

Adding a BZ buddy for payment/regression test update - I will be OOO until June 11th

@bfitzexpensify bfitzexpensify self-assigned this May 30, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Jun 2, 2024
@sonialiap
Copy link
Contributor

@cristipaval I see this was linked to a deploy blocker, was there a regression?

@abdulrahuman5196
Copy link
Contributor

cristipaval I see this was linked to a deploy blocker, was there a regression?

Unfortunately, yes. But its closed now.

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Not a regression

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.

  1. Create a new task on any chat
  2. Open the task report
  3. Update the description to include a multiline link
  4. Verify the task update message shows the link correctly (with an underscore)
  5. Right-click/long press the link
  6. Verify a Copy URL to clipboard menu is shown
  7. Open the task description again and save without changes anything
  8. Verify the task update message won't show when nothing is changes

@sonialiap

@sonialiap
Copy link
Contributor

sonialiap commented Jun 6, 2024

Since there was a regression I'm going to need to lower the payment by 50% to $125

Payment summary:
@abdulrahuman5196 reviewer $125 - paid ✔️
@bernhardoj contributor $125 - paid ✔️

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
No open projects
Archived in project
Development

No branches or pull requests

6 participants