Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-05-06] [HIGH] [Splits][$500] Split - Group chat is missing everywhere when created via FAB and bill is split in group chat #37519

Closed
6 tasks done
m-natarajan opened this issue Feb 29, 2024 · 66 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Feb 29, 2024

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: v1.4.45-1

Reproducible in staging?: Yes
Reproducible in production?: Yes
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:

  1. Go to staging.new.expensify.com
  2. Click FAB > Request money > Manual.
  3. Click a split bill with two users that have no prior chat via FAB.
  4. Navigate to a different chat.
  5. Note that the group chat remains in LHN and appears in Search.
  6. Go to FAB > Start chat.
  7. Create a group chat with two users that have no prior chat.
  8. In the group chat, click + > Split bill.
  9. Create a bill split.
  10. Go to a different chat.
  11. Open Search.

Expected Result:

The group chat will remain in LHN and appear in Search list.

Actual Result:

The group chat disappears from LHN and is missing in Search list.
This issue only happens when user creates a group chat first, then splits bill in the group chat (Step 6 - 11).
The only way to retrieve the group chat is by recreating it.

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6397108_1709216235472.bandicam_2024-02-29_17-45-05-083__1_.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016f541763635e6d84
  • Upwork Job ID: 1767854808847859712
  • Last Price Increase: 2024-03-13
  • Automatic offers:
    • mkhutornyi | Contributor | 0
    • bernhardoj | Contributor | 0
Issue OwnerCurrent Issue Owner: @mananjadhav
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 29, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

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

@m-natarajan
Copy link
Author

We think that this bug might be related to #vip-split-p2p-chat-groups
cc @arielgreen

@m-natarajan
Copy link
Author

@dylanexpensify 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.

@bernhardoj
Copy link
Contributor

bernhardoj commented Mar 2, 2024

Proposal

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

The group chat disappears from LHN even after splitting a bill and can't be found on the search page.

What is the root cause of that problem?

When we create a new group chat, the notificationPreference and visibleChatMemberAccountIDs from the BE response will be hidden and empty. After doing a split bill, both data are unchanged. It will be updated once we trigger the OpenReport request by reopening or refreshing the page. If notificationPreference is hidden, it will render nothing.

const shouldOverrideHidden = hasBrickError || isFocused || optionItem.isPinned;
if (isHidden && !shouldOverrideHidden) {
return null;
}

If visibleChatMemberAccountIDs is empty, we won't include it in the search results

if (!accountIDs || accountIDs.length === 0) {
return;
}

We previously encountered the notificationPreference issue here when adding a new comment to the report.

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

We can use the same solution from #29681, that is to update the notificationPreference to always if it's currently hidden when splitting bill.

if (ReportUtils.getReportNotificationPreference(splitChatReport) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) {
    splitChatReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;
}

And to show it on the search page, based on @marcochavezf comment here, we want to replace visibleChatMemberAccountIDs with participants, so we need to update the way to get the IDs in OptionsListUtils.

const accountIDs = isSelfDM ? [currentUserAccountID ?? 0] : report.visibleChatMemberAccountIDs ?? [];

const accountIDs = isSelfDM ? [currentUserAccountID ?? 0] : Object.keys(report.participants ?? {}).map(Number);

(we probably would need to do the same for assign task, send, and request money, but depends on how BE do it because for request money, BE never updates notificationPreference)

@melvin-bot melvin-bot bot added the Overdue label Mar 4, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?

@dylanexpensify
Copy link
Contributor

Apologies, I've been OOO sick, but am reviewing today!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 6, 2024
@dylanexpensify
Copy link
Contributor

Hmm @m-natarajan can you confirm this is still reproducible?

@melvin-bot melvin-bot bot removed the Overdue label Mar 11, 2024
@dylanexpensify
Copy link
Contributor

dylanexpensify commented Mar 11, 2024

Hm so the chat->bill create shows in the Search but not LHN (disappears). cc @arielgreen

@dylanexpensify
Copy link
Contributor

confirming here

@arielgreen arielgreen changed the title Split - Group chat is missing everywhere when created via FAB and bill is split in group chat [HIGH] [Splits] Split - Group chat is missing everywhere when created via FAB and bill is split in group chat Mar 12, 2024
@dylanexpensify
Copy link
Contributor

Confirmed and making external

@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Mar 13, 2024
@melvin-bot melvin-bot bot changed the title [HIGH] [Splits] Split - Group chat is missing everywhere when created via FAB and bill is split in group chat [$500] [HIGH] [Splits] Split - Group chat is missing everywhere when created via FAB and bill is split in group chat Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Mar 13, 2024

Proposal

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

The group chat disappears from the search page after creating a split bill.

What is the root cause of that problem?

when creating a split bill, the backend returns visibleChatMemberAccountIDs as empty arr which causes the group chat not to appear in the search records

so here we are assigning the visibleChatMemberAccountIDs to the accountIDs and excluding their reports from the result if the accountIDs list is empty:

const accountIDs = isSelfDM ? [currentUserAccountID ?? 0] : report.visibleChatMemberAccountIDs ?? [];

if (!accountIDs || accountIDs.length === 0) {
return;
}

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

according to Marcos comment we should use the participants object instead of the visibleChatMemberAccountIDs list when possible

so we need to change the prev line to:

const accountIDs = isSelfDM ? [currentUserAccountID ?? 0] : (report?.participants ? Object.keys(report.participants).map(Number) : report.visibleChatMemberAccountIDs) ?? [];

Test:

image

@mkhutornyi
Copy link
Contributor

Taking this over from @ntdiary (context)

Copy link

melvin-bot bot commented Mar 14, 2024

@dylanexpensify 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 melvin-bot bot added the Overdue label Mar 15, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Apr 16, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @mananjadhav

@dylanexpensify
Copy link
Contributor

waiting for deploy to prod -> regression period

@bernhardoj
Copy link
Contributor

We have a regression because looks like participants contains the current user ID, so we need to filter it out. The PR is ready to fix ti.

cc: @mananjadhav

@mananjadhav
Copy link
Collaborator

Taking a look.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 29, 2024
@melvin-bot melvin-bot bot changed the title [HIGH] [Splits][$500] Split - Group chat is missing everywhere when created via FAB and bill is split in group chat [HOLD for payment 2024-05-06] [HIGH] [Splits][$500] Split - Group chat is missing everywhere when created via FAB and bill is split in group chat Apr 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Apr 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.67-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-05-06. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Apr 29, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@mananjadhav] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@dylanexpensify
Copy link
Contributor

Payment coming up!

@dylanexpensify
Copy link
Contributor

dylanexpensify commented May 7, 2024

Payment summary:

Please apply/request!

@dylanexpensify
Copy link
Contributor

@bernhardoj paid out! @mananjadhav to request, closing issue

@dylanexpensify
Copy link
Contributor

JK - we need @mananjadhav to give regression step proposal

@dylanexpensify dylanexpensify reopened this May 7, 2024
@mananjadhav
Copy link
Collaborator

@dylanexpensify Shouldn't a regression test exist already for group chat in LHN? If they don't we can use the steps mentioned below.

These are the test steps.

  1. Create a new group chat with user that is not in your contacts
  2. Create a new split bill
  3. (Web/Desktop) Switch to another chat (Android/iOS/mWeb) Close the group chat
  4. Verify the group chat is still shown in LHN
  5. Go to search page and verify the group chat is shown

@mananjadhav
Copy link
Collaborator

Quick bump @dylanexpensify

@JmillsExpensify
Copy link

$250 approved for @mananjadhav

@lanitochka17
Copy link

Do we need to open a new bug or is it the same one?
The tester was able to reproduce this issue again.

Recording.1759.mp4

@mananjadhav
Copy link
Collaborator

We had fixed this for Split bill and group chat. But in the new video I can see you're trying Submit expense on DM. Could be a separate issue.

@dylanexpensify
Copy link
Contributor

Agree, @lanitochka17 separate issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants