App icon indicating copy to clipboard operation
App copied to clipboard

HIGH: [Polish] [$500] Broken message text in LHN when Inviting someone to room.

Open m-natarajan opened this issue 2 years ago • 77 comments

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: 1.4.12.0 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: @marcaaron Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1702330874424759

Action Performed:

  1. Create a new workspace
  2. Create a workspace room
  3. Invite a workspace member to the room
  4. Invite a non-workspace member to the room
  5. View the chat as the non-workspace member

Expected Result:

The last message text correctly shows "invited 2 users"

Actual Result:

the message text says "invited and"

Workaround:

unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [x] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Snip - (5) New Expensify - Google Chrome

invited chat text weird

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d4986375431dd52a
  • Upwork Job ID: 1734953294535315456
  • Last Price Increase: 2024-02-06
  • Automatic offers:
    • DylanDylann | Contributor | 0
    • dukenv0307 | Contributor | 0

m-natarajan avatar Dec 13 '23 15:12 m-natarajan

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

melvin-bot[bot] avatar Dec 13 '23 15:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 13 '23 15:12 melvin-bot[bot]

Bug0 Triage Checklist (Main S/O)

  • [ ] This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • [ ] This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • [ ] This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • [ ] This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • [ ] I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

melvin-bot[bot] avatar Dec 13 '23 15:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 13 '23 15:12 melvin-bot[bot]

Seems like this issue is non-reproducible anymore on the current main branch: image image

artus9033 avatar Dec 15 '23 16:12 artus9033

📣 @artus9033! 📣 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>

melvin-bot[bot] avatar Dec 15 '23 16:12 melvin-bot[bot]

Thanks @artus9033.

@m-natarajan are you still able to reproduce this issue?

sakluger avatar Dec 18 '23 22:12 sakluger

I also can't reproduce but may be following the steps incorrectly. I asked in the original Slack thread for help checking on reproduction.

sakluger avatar Dec 21 '23 21:12 sakluger

Closing as non-reproduceable.

sakluger avatar Dec 22 '23 17:12 sakluger

@sakluger QA team found the reproducible steps for this issue:

  1. Create a workspace room.
  2. Invite users.
  3. Send a message to another chat (if on web).
  4. Log out and log in.
  5. Refresh the page. Can you try again, please? Thank you! https://github.com/Expensify/App/assets/93399543/35f4287a-7e68-4631-9e8b-f9fe5948d36d

kbecciv avatar Jan 10 '24 18:01 kbecciv

@artus9033 are you able to reproduce with the above steps on iOS? If so, would you like to submit a proposal to fix?

sakluger avatar Jan 10 '24 23:01 sakluger

I reproduced. I think this should be fixed in backend.

Here's the root cause with example:

Screenshot 2024-01-15 at 8 01 59 AM

report data: Screenshot 2024-01-15 at 8 04 05 AM

reportActions associated with this report doesn't exist before opening report so it just shows lastMessageText.

After opening report, reportActions comes from openReport api. So last message is composed from last report action (actionName, targetAccountIDs.length):

Screenshot 2024-01-15 at 8 06 34 AM Screenshot 2024-01-15 at 8 08 46 AM

🎀 👀 🎀

aimane-chnaif avatar Jan 15 '24 07:01 aimane-chnaif

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

melvin-bot[bot] avatar Jan 15 '24 07:01 melvin-bot[bot]

@aimane-chnaif Quick question: Does the bug above gets fixed if we refresh the page or does it persist?

techievivek avatar Jan 15 '24 09:01 techievivek

@aimane-chnaif Quick question: Does the bug above gets fixed if we refresh the page or does it persist?

It persists as long as that report is not opened. (refresh app while on other report)

aimane-chnaif avatar Jan 15 '24 09:01 aimane-chnaif

Ok, great, thanks for confirming.

techievivek avatar Jan 15 '24 09:01 techievivek

I am able to reproduce this. Looking into the backend logic. Screenshot 2024-01-15 at 3 33 37 PM

techievivek avatar Jan 15 '24 10:01 techievivek

We construct the mention-user message correctly, but we strip out the HTML-tag-like structure when we convert the HTML to text. As a result, the content is reduced to commas and space.

Screenshot 2024-01-15 at 3 37 22 PM

@jasperhuangg Looks like you worked on the implementation: https://github.com/Expensify/Web-Expensify/pull/39506/files, Do you have any thoughts on handling this better?

techievivek avatar Jan 15 '24 10:01 techievivek

I am thinking maybe frontend can handle this differently i.e. rather than using the text content for LHN, they can parse the HTML content following this https://github.com/Expensify/App/blob/2be282e9ab2fa9aa289f298215b895e21dd4e01b/src/pages/home/report/ReportActionItemMessage.tsx#L39-L40

Because this seems broken only for LHN, the report action in the chat seems to be working fine. Screenshot 2024-01-15 at 3 57 32 PM

@aimane-chnaif Any thoughts?

techievivek avatar Jan 15 '24 10:01 techievivek

I am thinking maybe frontend can handle this differently i.e. rather than using the text content for LHN, they can parse the HTML content following this

That makes sense. But I am not sure if frontend has all necessary info to compose lastMessageText before opening report. i.e. personalDetail for accountID might not exist

aimane-chnaif avatar Jan 15 '24 15:01 aimane-chnaif

I think that should be fine since the report action handles it the same way for accountID with no personal details stored locally. But we can wait for @jasperhuangg to take a look into the bug and share his thoughts.

techievivek avatar Jan 17 '24 11:01 techievivek

It looks like this is because of accountID-based mentions.

This is definitely a back-end fix, and I believe this is a duplicate of https://github.com/Expensify/Expensify/issues/360572, which I plan on tackling today.

jasperhuangg avatar Jan 17 '24 14:01 jasperhuangg

@jasperhuangg are you sure this is a dupe of https://github.com/Expensify/Expensify/issues/360572? If so we should close this one in favor of the other issue.

sakluger avatar Jan 19 '24 20:01 sakluger

Actually I'm not entirely sure if it's the same bug, sorry for the confusion.

The front-end should have all the necessary information in Onyx personal details once this is merged https://github.com/Expensify/Auth/pull/9689 @techievivek. So that proposal should work, but we'll need to hold it on this issue: https://github.com/Expensify/App/issues/34175

jasperhuangg avatar Jan 22 '24 18:01 jasperhuangg

Seems like we're holding for https://github.com/Expensify/App/issues/34175

aimane-chnaif avatar Jan 25 '24 02:01 aimane-chnaif

Not overdue, holding working on the GH until https://github.com/Expensify/App/issues/34175 is done.

techievivek avatar Jan 29 '24 08:01 techievivek

https://github.com/Expensify/App/issues/34175 was closed

aimane-chnaif avatar Jan 31 '24 18:01 aimane-chnaif

The Auth PR that Jasper linked has been merged so I am guessing we can explore the frontend solution for this bug, no? @aimane-chnaif

techievivek avatar Feb 05 '24 13:02 techievivek

I'm not sure - in https://github.com/Expensify/App/issues/34175, @jasperhuangg said that we should not implement a front-end fix because it would break 1:1:1, but that may be a different front-end fix.

@jasperhuangg what would you recommend as a next step for this issue?

sakluger avatar Feb 05 '24 23:02 sakluger

The specific front end fix proposed by the contributor would break 1:1:1.

But I think we can still fix the front end to handle this correctly. We don't need to request the personal details here, we can just use the number of accountIDs in targetAccountIDs to say something like "invited X users".

jasperhuangg avatar Feb 05 '24 23:02 jasperhuangg