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
2.97k stars 2.48k forks source link

[$250] Chat - Room highlight is preserved for non existing room after an edit #40857

Open izarutskaya opened 1 week ago

izarutskaya commented 1 week 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.65-0 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. Navigate to staging.new.expensify.com
  2. Create a room
  3. Open the room report
  4. Type "#" followed by something random (e.g "#Random") and send the message
  5. Observe the highlight disappears after a few seconds
  6. Right click on the message sent on step 4 and click on edit comment
  7. Append some additional characters to the message without a whitespace in between (e.g "#RandomThings") and click on the tick mark

Expected Result:

The highlight should disappear after a few seconds

Actual Result:

The highlight is retained on the comment after editing the non existent room mention

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/c8d43b27-49f5-4827-9727-abc781b7929c

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e5afa01739ea945f
  • Upwork Job ID: 1785431677040029696
  • Last Price Increase: 2024-04-30
melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @johncschuster (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 commented 1 week ago

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

gijoe0295 commented 1 week ago

Proposal

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

The highlight is retained on the comment after editing the non existent room mention

What is the root cause of that problem?

This is a BE issue, UpdateComment API does not strip the mention-report html tag if the content does not link to a valid room while AddComment API does.

However, I think we could fix this in App. The check here does not cover the case that the mention text points to an invalid room:

https://github.com/Expensify/App/blob/eebd47cbd01a1ac62667f03a7eac96cae213d1c8/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx#L67

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

Modify the above check to include mentionDetails's reportID if it exists.

https://github.com/Expensify/App/blob/eebd47cbd01a1ac62667f03a7eac96cae213d1c8/src/components/HTMLEngineProvider/HTMLRenderers/MentionReportRenderer.tsx#L73

What alternative solutions did you explore? (Optional)

NA

johncschuster commented 1 week ago

It looks like "rooms" are related to #vip-vsb. Parking this in that project.

melvin-bot[bot] commented 5 days ago

@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 5 days ago

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

melvin-bot[bot] commented 5 days ago

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

johncschuster commented 5 days ago

I note @gijoe0295 believes this is a BackEnd issue 👍

rayane-djouah commented 4 days ago

I agree that this is a backend bug; fixing it from frontend as @gijoe0295 proposed, will cause the highlight not to be shown when sending the message offline (as reportID doesn't exist)

@johncschuster I think we should make this an Internal Hot Pick issue

melvin-bot[bot] commented 4 days ago

Current assignee @rayane-djouah is eligible for the Internal assigner, not assigning anyone new.

johncschuster commented 4 days ago

Thanks for that suggestion @rayane-djouah!