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.03k stars 2.54k forks source link

[$250] IOU-User is shown option to submit expense using group. #42261

Open izarutskaya opened 2 weeks ago

izarutskaya commented 2 weeks 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.74-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. Launch app
  2. Tap start chat
  3. Add a user and create group
  4. Tap header -- member -- invite
  5. Invite user A
  6. Login in mweb as user A
  7. As user A, note group chat in lhn
  8. As group admin, in Android app remove another user (not user A)
  9. In mweb, as member note green dot shown in LHN for removed user
  10. In mweb, tap on the chat and navigate to members page
  11. In Android app, as group admin tap back and "Leave group"
  12. In mweb, note in members page, now member is shown as "admin"
  13. Navigate to LHN
  14. Tap fab -- submit expense
  15. Enter an amount and tap next
  16. Select group shown in recent
  17. Tap submit

Expected Result:

User must not be shown option to submit expense using group.

In group user's LHN, when user removed green dot is shown.

Actual Result:

User is shown option to submit expense using group.

In group user's LHN, when user removed green dot must not be shown.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/4d114db3-faa7-4454-82ea-2b6e84c8a3c2

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01099fb6a88b2692fc
  • Upwork Job ID: 1791216875339001856
  • Last Price Increase: 2024-05-16
  • Automatic offers:
    • ishpaul777 | Reviewer | 102546813
    • nkdengineer | Contributor | 102546815
melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @sakluger (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 2 weeks ago

We think this issue might be related to the #vip-vsb.

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

sakluger commented 2 weeks ago

@joekaufmanexpensify I'm assigning to you while I'm OOO for the next two weeks. I'll take it back over if it's still open after May 31.

nkdengineer commented 2 weeks ago

Proposal

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

  1. In group user's LHN, when user removed green dot must not be shown.
  2. User is shown option to submit expense using group.

What is the root cause of that problem?

  1. This is a back-end issue, in a group of user [A, B, C], A is the admin, C is the logged in user.

When user A removes user B, it will show the "removed B" text when user C views it. The problem here is the lastMentionedTime of the group chat is pushed by Pusher in user C's group chat view when "removed B" report action comes. This is wrong because lastMentionedTime is supposed to be the time when "current user is mentioned", not "any user is mentioned".

Screenshot 2024-05-21 at 11 53 16β€―PM

This causes the green dot to show because we have this condition when checking requiresAttentionFromCurrentUser.

When reloading and openReport runs, the lastMentionedTime will not be there and the green dot disappear.

  1. When we generate the option from report here, we're setting the login incorrectly.

In the case of group chat with 1 member, hasMultipleParticipants is false but it's still a group chat so should not have login or accountID in the result like 1-1 chat.

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

  1. We need to fix back-end so that if user B is removed, back-end will not push (via Pusher) lastMentionedTime to user C's report because user C is not mentioned.

  2. Update this to

    if (!hasMultipleParticipants && !ReportUtils.isGroupChat(report)) {

    We need to also check other report types (like room) to make sure the same case doesn't happen, and similar fix can be applied if there's problem.

What alternative solutions did you explore? (Optional)

NA

joekaufmanexpensify commented 2 weeks ago

I can reproduce both parts of the bug. Fixing both makes sense to me!

joekaufmanexpensify commented 1 week ago

Waiting for @ishpaul777 review

ishpaul777 commented 1 week ago

on my radar, expect to review in 4-5 hours

ishpaul777 commented 1 week ago

I can reproduce both issues @nkdengineer Can you please retest again.

https://github.com/Expensify/App/assets/104348397/eb55616d-6a7e-433a-bcff-142a1c32f4ac

Your proposal for the second issue makes sense to me πŸ‘

nkdengineer commented 1 week ago

Thanks for the video @ishpaul777, I can reproduce now.

That 1st issue's a back-end issue. Proposal updated to mention how to fix it.

joekaufmanexpensify commented 1 week ago

@ishpaul777 So seems like we need to both hire someone for the FE piece, and then find a volunteer for the BE?

ishpaul777 commented 1 week ago

I'll confirm this in few minutes @joekaufmanexpensify

ishpaul777 commented 1 week ago

Yes the first issue seems to be backend related. For the second issue Proposal from @nkdengineer LGTM!

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

melvin-bot[bot] commented 1 week ago

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

joekaufmanexpensify commented 1 week ago

Sounds good! Perhaps @chiragsalian can handle the BE portion too after reviewing the proposal?

melvin-bot[bot] commented 5 days ago

@sakluger, @chiragsalian, @joekaufmanexpensify, @ishpaul777 Eep! 4 days overdue now. Issues have feelings too...

joekaufmanexpensify commented 4 days ago

Pending @chiragsalian review of selected proposal

joekaufmanexpensify commented 3 days ago

@chiragsalian will you be able to review the proposal soon?

melvin-bot[bot] commented 2 days ago

@sakluger @chiragsalian @joekaufmanexpensify @ishpaul777 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!

joekaufmanexpensify commented 1 day ago

Bumped Chirag 1:1

chiragsalian commented 1 day ago

Proposal LGTM. Feel free to create a PR to tackle item 2 in your proposal @nkdengineer.

@joekaufmanexpensify could you create another issue to handle issue 1 mentioned by nkdengineer which is backend related?

melvin-bot[bot] commented 1 day ago

πŸ“£ @ishpaul777 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 1 day ago

πŸ“£ @nkdengineer πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–