Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.12k stars 2.62k forks source link

[$250] Mentions are omitted from the thread title #42159

Open m-natarajan opened 1 month ago

m-natarajan commented 1 month ago

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.73-3 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: @sakluger Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1715694813328969

Action Performed:

  1. Open any chat report
  2. Send a message with mentioning other users
  3. Start a thread from this message
  4. Observe the header

Expected Result:

Header should show up with mentions (e.g @mnata)

Actual Result:

Mentions are not showed up in the title

Workaround:

unknonw

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence image (4) image (3) thread mention

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c334929c73b11c6c
  • Upwork Job ID: 1790763344331558912
  • Last Price Increase: 2024-05-15
Issue OwnerCurrent Issue Owner: @s77rt
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @bfitzexpensify (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[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

kmbcook commented 1 month ago

It looks like the backend is setting action.message.text correctly when a comment with mention is added, and that the backend is also removing that mention from that same action.message.text when OpenReport is called.

CleverWolf1220 commented 1 month ago

Proposal

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

Mentions are omitted from the thread title

What is the root cause of that problem?

We get title with getReportName() function. Inside that function, we call getReportActionMessage() to get text. And it returns reportAction.messge.text like in below code part. Mentions are not included in text so we can't display mentions in thread title.

https://github.com/Expensify/App/blob/3a35c1ce9145be6dc69248c2cdb3d8046b71352c/src/libs/ReportUtils.ts#L3117

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

We have to get html from getReportActionMessage() and fix ui part to render mentions since currently it is only showing string.

  1. We have to change reportAction?.message?.[0]?.text to reportAction?.message?.[0]?.html in this part
  2. Then as thread title is rendered here, we have to update DisplayNamesWithoutTooltip and DisplayNamesWithToolTip in DisplayNames.
    • Update this part with <RenderHTML html={ReportUtils.formatReportLastMessageText(fullTitle)}/> so that it can render mentions.
    • Also update this part with <RenderHTML html={fullTitle}/> as well.

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 1 month ago

📣 @CleverWolf1220! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
kaushiktd commented 1 month ago

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

Mentions are omitted from the thread title

What is the root cause of that problem?

The thread title is determined by calling the function getReportName() from ReportUtils. This function simply returns plain text without any user mentions or extra formatting. Furthermore, the title is rendered as straightforward text, eliminating the need for any parsing. This is the primary reason why user mentions are excluded from the title. You can see the image. Screenshot 2024-05-16 at 1 12 33 PM

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

To address this, you should modify the reportAction array response to return HTML content instead of plain text here as mention below. This allows you to include user mentions or any additional formatting needed for the header title. Then, when rendering the header title, ensure it's treated as HTML content to display the formatted title correctly.

reportAction?.message?.[0]?.html 

What alternative solutions did you explore? (Optional)

You need to check the backend because the title is rendered as plain text in the header. However, from the backend, it returns the text without any user mentions in the text parameter of reportAction.

Image ![Screenshot 2024-05-16 at 1 22 15 PM](https://github.com/Expensify/App/assets/43398804/93b81980-07cd-48b7-ba80-57426d18c364)
dragnoir commented 1 month ago

BE issue, when the AddComment API is sent, the BE turns the right value

image

but with the next API call, GetNewerActions, the BE turns the value without the mention

image

s77rt commented 1 month ago

🎀 👀 🎀 Internal

After opening a thread report the BE also returns the parent report action but it sends incorrect message.text. This seems affecting both OpenReport and GetNewerActions

Screenshot 2024-05-16 at 6 06 12 PM
melvin-bot[bot] commented 1 month ago

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

hayata-suenaga commented 1 month ago

oh completely blank 😓 I'm going to take a look at this when I have time. Moving the priority to weekly

Screenshot 2024-05-20 at 10 57 53 AM
melvin-bot[bot] commented 1 month ago

@s77rt @bfitzexpensify @hayata-suenaga 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!

s77rt commented 1 month ago

Can we move this to Internal?

mvtglobally commented 3 weeks ago

Issue not reproducible during KI retests. (First week)

melvin-bot[bot] commented 3 weeks ago

This issue has not been updated in over 15 days. @s77rt, @bfitzexpensify, @hayata-suenaga 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!

s77rt commented 3 weeks ago

This is still internal

hayata-suenaga commented 2 weeks ago

will take a look at this again when I have time this week.

mvtglobally commented 1 week ago

Issue not reproducible during KI retests. (Second week)

mvtglobally commented 1 day ago

Issue not reproducible during KI retests. (Third week)