Skip to content

[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

Description

@lanitochka17

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

Activity

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

    @melvin-bot

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

  3. lanitochka17 commented on Apr 3, 2024

    @lanitochka17
    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

  4. lanitochka17 commented on Apr 3, 2024

    @lanitochka17
    Author

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

  5. bernhardoj commented on Apr 3, 2024

    @bernhardoj
    Contributor

    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 ?? ''));

  6. added
    External
    on Apr 4, 2024
  7. 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[/+] on Apr 4, 2024
  8. melvin-bot commented on Apr 4, 2024

    @melvin-bot
  9. added
    Help Wanted
    on Apr 4, 2024
  10. melvin-bot commented on Apr 4, 2024

    @melvin-bot

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

  11. 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[/+] on Apr 4, 2024
  12. 50 remaining items

  13. added
    Bug
    and removed
    Bug
    on May 30, 2024
  14. melvin-bot commented on May 30, 2024

    @melvin-bot

    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.

  15. added
    Daily
    and removed
    Weekly
    on May 30, 2024
  16. bfitzexpensify commented on May 30, 2024

    @bfitzexpensify
    Contributor

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

  17. added
    Daily
    and removed
    Daily
    on Jun 2, 2024
  18. sonialiap commented on Jun 4, 2024

    @sonialiap
    Contributor

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

  19. abdulrahuman5196 commented on Jun 4, 2024

    @abdulrahuman5196
    Contributor

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

    Unfortunately, yes. But its closed now.

  20. abdulrahuman5196 commented on Jun 4, 2024

    @abdulrahuman5196
    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

  21. sonialiap commented on Jun 6, 2024

    @sonialiap
    Contributor

    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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions