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.56k stars 2.9k forks source link

[$250] Room - Behavior is different in expensifail& gmail a/c on pasting&sending removed users message #49395

Closed IuliiaHerets closed 1 month ago

IuliiaHerets commented 2 months 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: 9.0.37-0 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Open new expensifail account in mweb
  2. Create a room
  3. Open new gmail account in app
  4. Create a room
  5. In mweb, open room chat
  6. Invite few users with custom name and remove them
  7. Navigate to conversation page
  8. Long press the removed users system message and select copy to clipboard
  9. Paste in compose and send the message
  10. Note both message and whisper shows only user id.
  11. In android app, open room chat
  12. Paste and send the message
  13. Note both message and whisper shows user id briefly and changed to custom name.

From gmail if we copy removed users message and paste in expensifail Or vive versa, this issue happens.

Expected Result:

Both in removed user message and in whisper, behavior must be same in expensifail and gmail account.

Actual Result:

Both in removed user message and in whisper, behavior is different in expensifail and gmail account on pasting and sending removed users message.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/9e1d633f-25cb-4bec-8587-08ec7686cfba

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836832247831403344
  • Upwork Job ID: 1836832247831403344
  • Last Price Increase: 2024-09-26
Issue OwnerCurrent Issue Owner: @rushatgabhane
melvin-bot[bot] commented 2 months ago

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

IuliiaHerets commented 2 months ago

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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

koko57 commented 1 month ago

Hello 🙂 I'm Agata from Callstack, maybe I can help with this issue?

melvin-bot[bot] commented 1 month ago

@strepanier03, @rushatgabhane Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 1 month ago

@strepanier03, @rushatgabhane Huh... This is 4 days overdue. Who can take care of this?

koko57 commented 1 month ago

I was working on another issues, but if I still can help I'll be happy to do so!

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

@strepanier03, @rushatgabhane Still overdue 6 days?! Let's take care of this!

koko57 commented 1 month ago

I've noticed that displaying a mention is different for different cases - if the user is from the same domain (except gmail.com) we display the login with the '@domain' cut off (like "@agata.kosior+8") but for the users with other domains we display "@[displayName]" as a mention. It is also not consistent for the message and LHN - in the screenshots you can see that in the LHN we display "@[displayName]" and in the message we have the login without the domain. Shouldn't we ALWAYS display "@[displayName]" and fallback to the login when displayName is missing/not set? What is the expected behavior? @rushatgabhane @strepanier03

Screenshot 2024-09-30 at 18 16 41 Screenshot 2024-09-30 at 18 34 43 Screenshot 2024-09-30 at 18 34 36
melvin-bot[bot] commented 1 month ago

@strepanier03, @rushatgabhane 10 days overdue. I'm getting more depressed than Marvin.

rushatgabhane commented 1 month ago

yeah i agree ^

not sure why we're removing the domain. the mention should show the display name and fallback to login.

koko57 commented 1 month ago

ok, thanks! So I will continue my investigation and will try to find a solution

koko57 commented 1 month ago

ok, I've found the culprit of displaying a display name or a login - this line: https://github.com/Expensify/App/blob/c7ee85b2ea207159ef85932055aced28d5d2e29a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx#L62

when we don't have user's login in personalDetails we fallback to displayName. I wonder why we're doing it this way and we prioritize user login instead of user name. I'll check why we don't have user login for these cases we display displayName as a handle, but probably it's because we haven't have any interaction with these users.

koko57 commented 1 month ago

Yes, if we don't have a chat with the person we don't have the login in personal details.

Screenshot 2024-10-02 at 20 42 39 Screenshot 2024-10-02 at 20 42 47 Screenshot 2024-10-02 at 21 08 42

I've also noticed that in some cases the displayName is displayed first, then when we go to user's details page it changes to the login (we get more details in OpenPublicProfilePage response). It doesn't look nice

The solution seems obvious and rather simple - reverse the order of getting the value for mentionDisplayText https://github.com/Expensify/App/blob/c7ee85b2ea207159ef85932055aced28d5d2e29a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx#L62

and check the other locations where we use mentions and change them as well - like the "copy to clipboard" functionality and mentions suggestions.

melvin-bot[bot] commented 1 month ago

@strepanier03 @rushatgabhane 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!

mountiny commented 1 month ago

Closing this one for now as the issue was part of the VSB project and we will focus on this again in future