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 #49355][$250] Room - HTML text is shown in Room Description #51048

Closed
1 of 8 tasks
lanitochka17 opened this issue Oct 17, 2024 · 12 comments
Closed
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 17, 2024

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: 9.0.50-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the iOS Hybrid app and access ND
  2. Sign into a valid account
  3. Go to Start Chat > Create a room
  4. After creation, add any description (For example: @test)
  5. Go back to the room Chat and send a message and observe the description text

Expected Result:

User expects the description to be unaffected

Actual Result:

HTML text is displayed after sending a message (OR leaving and joining the room via message)

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6638033_1729189658092.HTML_shown_after_leaving_and_joining_room_via_message.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021847054312559267621
  • Upwork Job ID: 1847054312559267621
  • Last Price Increase: 2024-10-24
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 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.

@lanitochka17
Copy link
Author

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

@Shahidullah-Muffakir
Copy link
Contributor

Shahidullah-Muffakir commented Oct 17, 2024

Proposal

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

The room description is currently displayed as an object, rather than plain text.

What is the root cause of that problem?

This issue occurs because the room description is being handled as a JSON object, but we are not properly parsing it or accessing the html property inside the objec

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

To resolve the issue, we need to parse the JSON object and extract the html property before processing the description

as:

function getReportDescriptionText(report: OnyxEntry<Report>): string {

as:
return report?.description ? Parser.htmlToText(JSON.parse(report.description)?.html || '') : '';
and also in the welcome text section In the :

function getRoomWelcomeMessage(report: OnyxEntry<Report>): WelcomeMessage {

@huult
Copy link
Contributor

huult commented Oct 17, 2024

Proposal

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

HTML text is shown in Room Description

What is the root cause of that problem?

This problem is caused by a change in the backend data type, specifically at the AddComment API. Other APIs are not affected. Previously, the response for report?.description was {description: "welcome text"}, but after the update, it responds with {description: "{"html":"welcome text"}"}. As a result, this issue occurs.

  • Screenshot 2024-10-18 at 03 32 03

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

To fix this issue, we have two options. The first option is to update the backend so that the AddComment API returns the description in the old format. The second option is to update the report description after calling the AddComment API and use the description from Onyx. The code changes would be as follows:

//.src/libs/actions/Report.ts#L548
 const successData: OnyxUpdate[] = [
        {
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
            value: successReportActions,
        },
+        {
+            onyxMethod: Onyx.METHOD.MERGE,
+            key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
+            value: {
+                description: report?.description,
+            },
+       },
+    ];
Screen.Recording.2024-10-18.at.03.38.03.mov

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Oct 17, 2024
@melvin-bot melvin-bot bot changed the title Room - HTML text is shown in Room Description [$250] Room - HTML text is shown in Room Description Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 2024

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

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

melvin-bot bot commented Oct 17, 2024

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

@truph01
Copy link
Contributor

truph01 commented Oct 18, 2024

Dupe #49355

@dylanexpensify dylanexpensify moved this to Release 3: Fall 2024 (Nov) in [#whatsnext] #expense Oct 18, 2024
@dylanexpensify dylanexpensify moved this from Release 3: Fall 2024 (Nov) to Hot Picks in [#whatsnext] #expense Oct 18, 2024
@dylanexpensify dylanexpensify moved this from Hot Picks to Release 3: Fall 2024 (Nov) in [#whatsnext] #expense Oct 18, 2024
Copy link

melvin-bot bot commented Oct 21, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Oct 21, 2024
@ZhenjaHorbach
Copy link
Contributor

Dupe #49355

Hmmmm
Yeah
Looks like these issues are similar

@kadiealexander
Let's add HOLD and retest when this PR will be merged

@melvin-bot melvin-bot bot removed the Overdue label Oct 22, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Oct 24, 2024
@kadiealexander kadiealexander changed the title [$250] Room - HTML text is shown in Room Description [HOLD for #49355][$250] Room - HTML text is shown in Room Description Oct 25, 2024
@kadiealexander kadiealexander added Weekly KSv2 and removed Daily KSv2 labels Oct 25, 2024
@melvin-bot melvin-bot bot removed the Overdue label Oct 25, 2024
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@ZhenjaHorbach
Copy link
Contributor

Issue not reproducible during KI retests. (First week)

Confirm !

@kadiealexander
Let's close this issue
It was fixed in this PR

@github-project-automation github-project-automation bot moved this from External Bugs and Follow Up Issues to Done in [#whatsnext] #expense Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
Archived in project
Development

No branches or pull requests

7 participants