App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Split - Group chat does not show bill creator name in LHN preview after refreshing the page

Open lanitochka17 opened this issue 10 months ago β€’ 29 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.60-5 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Request money > Manual
  3. Create a split bill with two users
  4. Once landed in group chat, note that group chat in LHN shows the bill creator name in the preview
  5. Refresh the page

Expected Result:

The group chat will continue to show the bill creator name in LHN preview after refreshing the page

Actual Result:

The group chat does not show the bill creator name in LHN preview after refreshing the page

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/f9407c5a-6c4d-4aee-808a-ce4639cb42c2

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0126a3e7c5e2856078
  • Upwork Job ID: 1777107502133911552
  • Last Price Increase: 2024-04-28

lanitochka17 avatar Apr 04 '24 19:04 lanitochka17

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

melvin-bot[bot] avatar Apr 04 '24 19:04 melvin-bot[bot]

@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

lanitochka17 avatar Apr 04 '24 19:04 lanitochka17

Proposal

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

The LHN subtitle shows the sender name when creating the split bill, but then it disappears.

What is the root cause of that problem?

When we refresh/wait for a moment, we will get the correct response from the BE and the sender name disappears is already correct because we don't want to show the sender name if it's coming from ourself. https://github.com/Expensify/App/blob/2995f2c79751d5096919eb98a26e0bd7b8533658/src/libs/OptionsListUtils.ts#L529-L533

The logic to show the sender name is, by taking the report lastActorAccountID and getting the user data from the ID. https://github.com/Expensify/App/blob/2995f2c79751d5096919eb98a26e0bd7b8533658/src/libs/SidebarUtils.ts#L297

However, when we create a split bill, the lastActorAccountID is 0, so the user detail is empty. https://github.com/Expensify/App/blob/2995f2c79751d5096919eb98a26e0bd7b8533658/src/libs/ReportUtils.ts#L3781

If it's empty, we will get it from the last report action person data which contains the user display name. https://github.com/Expensify/App/blob/2995f2c79751d5096919eb98a26e0bd7b8533658/src/libs/SidebarUtils.ts#L299-L307

Because 0 is not the same as the current user ID, the current user display name is shown as the sender.

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

Set the lastActorAccountID optimistically to currentUserAccountID when creating a split bill (and revert it when fails). We did this when adding a message/task too.

We might need to do this for other money request too.

What alternative solutions did you explore? (Optional)

  1. Don't show the display name when the lastActorAccountID is 0.

OR

  1. If we always want to show the sender name, we need to remove the accountID check (lastActorDetails.accountID !== currentUserAccountID) here. https://github.com/Expensify/App/blob/9a6cafcabfcbaa4f81fe57d0fecbeab682b8309a/src/libs/OptionsListUtils.ts#L536-L537

bernhardoj avatar Apr 05 '24 13:04 bernhardoj

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

melvin-bot[bot] avatar Apr 07 '24 22:04 melvin-bot[bot]

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

melvin-bot[bot] avatar Apr 07 '24 22:04 melvin-bot[bot]

Reviewing proposals

eh2077 avatar Apr 11 '24 04:04 eh2077

@bernhardoj 's proposal looks good to me. I agree with their RCA and their solution. I also agree we should fix other money request flows together.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

eh2077 avatar Apr 11 '24 08:04 eh2077

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

melvin-bot[bot] avatar Apr 11 '24 08:04 melvin-bot[bot]

πŸ“£ 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] avatar Apr 14 '24 16:04 melvin-bot[bot]

@aldo-expensify bump on this!

kadiealexander avatar Apr 15 '24 04:04 kadiealexander

I have some doubts about the "Expected results" being correct here. If we say that the frontend is right, and the split creator name shouldn't appear in the report's last message in the LHN from the perspective of the creator, this means that the last message of the report is different for each participant, and I think we may want to avoid that.

@marcaaron can I get your eyes here since I think you know about groups. πŸ™

aldo-expensify avatar Apr 15 '24 17:04 aldo-expensify

I agree 1000%.

With Group Chats, we did not really change much about how this works on the frontend side of things though - just replaced the Group DM with a Group Chat so I'm not sure where we went wrong or if this was just always awkward.

Could probably take this to #vip-split room and loop in whoever is working on Splits now. cc @arielgreen @dubielzyk-expensify and @youssef-lr? Can we see about rolling this in as a polish item for this project?

marcaaron avatar Apr 16 '24 00:04 marcaaron

Seems like a minor bug. I agree that it'd be nice to fix it though, but fine with this as a polish item

dubielzyk-expensify avatar Apr 16 '24 02:04 dubielzyk-expensify

@kadiealexander Based on the discussions above, can you help to update the Expected results section of this issue?

eh2077 avatar Apr 17 '24 01:04 eh2077

@kadiealexander @aldo-expensify @eh2077 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!

melvin-bot[bot] avatar Apr 18 '24 18:04 melvin-bot[bot]

@kadiealexander Based on the discussions above, can you help to update the Expected results section of this issue?

@kadiealexander Friendly bump!

eh2077 avatar Apr 19 '24 00:04 eh2077

Or @bernhardoj would you like to update your proposal according to @aldo-expensify 's https://github.com/Expensify/App/issues/39647#issuecomment-2057456493 ?

eh2077 avatar Apr 19 '24 00:04 eh2077

Updated!

bernhardoj avatar Apr 19 '24 00:04 bernhardoj

@bernhardoj Thanks for the update!

Based on the above discussions, yes, it makes more sense to Don't show the display name when the lastActorAccountID is 0.

So, @bernhardoj 's alternative solution looks good.

@aldo-expensify All yours.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

eh2077 avatar Apr 19 '24 16:04 eh2077

Current assignee @aldo-expensify is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar Apr 19 '24 16:04 melvin-bot[bot]

πŸ“£ 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] avatar Apr 21 '24 16:04 melvin-bot[bot]

@kadiealexander, @aldo-expensify, @eh2077 Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Apr 22 '24 18:04 melvin-bot[bot]

@aldo-expensify Should we assign @bernhardoj to move this issue forward?

eh2077 avatar Apr 22 '24 23:04 eh2077

It is not clear to me from the conversation which option we want, so I asked here https://expensify.slack.com/archives/C05RECHFBEW/p1713833726038629 to confirm

aldo-expensify avatar Apr 23 '24 00:04 aldo-expensify

Sorry @eh2077 @bernhardoj for the back and forward. The conclusion from the slack conversation is:

The bill creator name should appear in the last message, and the front end should take care of that. The backend won't send the last message with the bill creator in it.

I think this was what @bernhardoj original solution was trying to achieve, correct?

This code seems related to that:

https://github.com/Expensify/App/blob/42d4ed7b72dc979df430a2a7eac4ba30a3eac790/src/libs/OptionsListUtils.ts#L711-L713

aldo-expensify avatar Apr 26 '24 05:04 aldo-expensify

@aldo-expensify Thanks for driving clarity.

@bernhardoj Can you take some time to update proposal based on the expected result^ ?

eh2077 avatar Apr 26 '24 14:04 eh2077

I just noticed a mistake in the expected results I typed above. The backend WON'T send the bill creator as part of the last message:

image

aldo-expensify avatar Apr 26 '24 17:04 aldo-expensify

My proposal has both behaviors, showing or not showing the sender name if it's the current user. If I understand correctly from @aldo-expensify comment, we always want to show the sender's name, so it should be the 2nd alternative.

image

bernhardoj avatar Apr 27 '24 13:04 bernhardoj

πŸ“£ 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] avatar Apr 28 '24 16:04 melvin-bot[bot]

@bernhardoj Thanks for the update. Yeah, the 2nd alternative makes sense to me.

@aldo-expensify All yours.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

eh2077 avatar Apr 29 '24 05:04 eh2077