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.36k stars 2.78k forks source link

[$500] LHN - 1:1 DM is delayed when creating a split bill in group from other account #32921

Closed kbecciv closed 9 months ago

kbecciv commented 9 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: 1.4.11-13 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: Applause - Internal Team Slack conversation:

Action Performed:

Precondition: user should be signed to account A on the main device and account B

  1. Open second platform with account B
  2. Create a Group chat with account A and some other accounts
  3. Make a split bill for all participants
  4. Open the app on the main device with account A
  5. Observe the created 1:1 DM chat in LHN doesn't show until much later

Expected Result:

1:1 DM with green dot should be displayed immediately after request money is made

Actual Result:

1:1 DM with green dot IS NOT displayed immediately after request money is made

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/93399543/f24161ba-c600-4f3b-a6c1-9b0a189ea4eb

https://github.com/Expensify/App/assets/51066321/d1355779-f9a6-4dba-90b2-c1422a6f6bcc

2023-12-12_14-57-48

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014080a5180fd1811b
  • Upwork Job ID: 1734580136891052032
  • Last Price Increase: 2023-12-19
melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

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

melvin-bot[bot] commented 9 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 9 months ago

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

shahinyan11 commented 9 months ago

Proposal

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

LHN - Green dot not displayed for 1:1 DM when create a split bill in group from other account

What is the root cause of that problem?

The requiresAttentionFromCurrentUser function always returns false . Because there is not if condition which returns true in this case

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

  1. We can add isLastActionSplitBill key in returned result object of getOptionData function. To do that we can add below code after this line
    result.isLastActionSplitBill = lodashGet(reportAction, 'originalMessage.type', '') === CONST.IOU.REPORT_ACTION_TYPE.SPLIT;
  2. Add below code in requiresAttentionFromCurrentUser function
    if (optionOrReport.isUnread && optionOrReport.isLastActionSplitBill) {
    return true;
    }

What alternative solutions did you explore? (Optional)

Do the above 1 step differently

Create new function isLastActionSplitBill in ReportUtils.ts similar to isUnreadWithMention

function isLastActionSplitBill(report: OnyxEntry<Report>, reportAction: OnyxEntry<ReportAction>): boolean {
    const isSplit = lodashGet(reportAction, 'originalMessage.type', '') === CONST.IOU.REPORT_ACTION_TYPE.SPLIT;

    return isUnread(report) && isSplit
}

And then add this code in getOptionData function after this line

result.isLastActionSplitBill = ReportUtils.isLastActionSplitBill(report, reportAction);
Christinadobrzyn commented 9 months ago

I can reproduce this (added another video to the OP section) and I think it might fit in with vip-split-p2p-chat-groups - asking Mitch for some guidance in a DM.

Christinadobrzyn commented 9 months ago

Actually, it looks like the green dot just might be delayed. I'm seeing it now (after I've closed the app). Updated the OP about this.

image

olci34 commented 9 months ago

I can't recreate this for web. Here is a video that it works.

https://github.com/Expensify/App/assets/64434231/28540285-e45e-45ea-93b3-c5647c9f4bff

Contributor details Your Expensify account email: developerogulcan@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~0170d708ff13327669

melvin-bot[bot] commented 9 months ago

📣 @olci34! 📣 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>
Christinadobrzyn commented 9 months ago

This is Split bill/1:1 DM issue so I think this can probably be linked to either

I'm leaning towards Wave 7 so going to add it to that project unless Gabi or Rach, you think otherwise!

I don't think this is a high priority as it looks like it's a UX issue and the green dot does display, it just takes a minute to show.

melvin-bot[bot] commented 9 months ago

@rushatgabhane, @Christinadobrzyn Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 9 months ago

@rushatgabhane, @Christinadobrzyn Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Christinadobrzyn commented 9 months ago

I think this might be part of Wave 7 or VIP - Split P2P Chat Groups so reaching out to find out if either of those are a good fit! I'll follow up as soon as possible.

In the meantime we can still review proposals @rushatgabhane

Christinadobrzyn commented 9 months ago

Asking in the VIP-split-p2p-chat groups channel about this https://expensify.slack.com/archives/C05RECHFBEW/p1702933454266189

rushatgabhane commented 9 months ago

@Christinadobrzyn I can't repro this issue. The green dot shows immediately! Same as @olci34 https://github.com/Expensify/App/issues/32921#issuecomment-1854772641

melvin-bot[bot] commented 9 months ago

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

Christinadobrzyn commented 9 months ago

Ah yep! I just tested again and it does look like the DM has a green dot immediately. I think this can be closed without action! Thanks @rushatgabhane and @olci34 for testing!