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-07-10] [$250] Split - 1:1 DMs are not instantly created when splitting expense (compared to prod) #44216

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

Comments

@m-natarajan
Copy link

m-natarajan commented Jun 22, 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: 9.0.1-0
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4661606
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. Go to FAB > Split expense > Manual.
  3. Enter amount > Next.
  4. Select a few users and split the expense.
  5. Note that 1:1 DMs are created after some delay.
  6. Repeat Step 2 to 4 on production. The individual chats are created instantly.

Expected Result:

1:1 DMs from group expense split will be created instantly as soon as the expense is split (production behavior).

Actual Result:

1:1 DMs from group expense split are created only after some delay when the expense is split.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

20240622_233136.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fcb662e1350f5ad9
  • Upwork Job ID: 1805172572628569117
  • Last Price Increase: 2024-06-24
  • Automatic offers:
    • ZhenjaHorbach | Reviewer | 102859050
    • bernhardoj | Contributor | 102859053
Issue OwnerCurrent Issue Owner: @abekkala
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 22, 2024
Copy link

melvin-bot bot commented Jun 22, 2024

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

Copy link

melvin-bot bot commented Jun 22, 2024

Triggered auto assignment to @marcochavezf (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@m-natarajan
Copy link
Author

@marcochavezf 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

@m-natarajan
Copy link
Author

We think that this bug might be related to #vip-vsb

@bernhardoj
Copy link
Contributor

Proposal

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

The 1:1 DMs are not immediately shown in LHN when doing a split bill.

What is the root cause of that problem?

When we create a new split bill, we already create the DMs optimistically. However, the DMs isn't visible in the LHN because it's detected as an empty chat/report even though there is a report preview action.

App/src/libs/ReportUtils.ts

Lines 5468 to 5471 in 0176052

// Hide chats between two users that haven't been commented on from the LNH
if (excludeEmptyChats && isEmptyChat && isChatReport(report) && !isChatRoom(report) && !isPolicyExpenseChat(report) && !isSystemChat(report) && !isGroupChat(report) && canHideReport) {
return false;
}

Turns out the optimistic report preview action has an empty text/html. If we see the optimistic code, we get the optimistic message from getReportPreviewMessage by passing the optimistic IOU report.

const message = getReportPreviewMessage(iouReport);

But in getReportPreviewMessage, if iouReportAction is empty, which is true for our case, it will return reportActionMessage which is empty too.

App/src/libs/ReportUtils.ts

Lines 2942 to 2947 in 0176052

const reportActionMessage = ReportActionsUtils.getReportActionHtml(iouReportAction);
if (isEmptyObject(report) || !report?.reportID || isEmptyObject(iouReportAction)) {
// The iouReport is not found locally after SignIn because the OpenApp API won't return iouReports if they're settled
// As a temporary solution until we know how to solve this the best, we just use the message that returned from BE
return reportActionMessage;

The reason we do the early return is to satisfy the type. In here, we pass the iouReportAction to isMoneyRequestAction which doesn't accept empty object.

const originalMessage = ReportActionsUtils.isMoneyRequestAction(iouReportAction) ? ReportActionsUtils.getOriginalMessage(iouReportAction) : undefined;

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

We shouldn't return early when iouReportAction is empty. It will always be empty when creating a new optimistic report preview.

So, the solution is, first, don't return early when iouReportAction is empty. (remove || isEmptyObject(iouReportAction))

App/src/libs/ReportUtils.ts

Lines 2944 to 2948 in 0176052

if (isEmptyObject(report) || !report?.reportID || isEmptyObject(iouReportAction)) {
// The iouReport is not found locally after SignIn because the OpenApp API won't return iouReports if they're settled
// As a temporary solution until we know how to solve this the best, we just use the message that returned from BE
return reportActionMessage;
}

To fix the type issue, we can add a check whether the iouReportAction is empty or not.

const originalMessage = ReportActionsUtils.isMoneyRequestAction(iouReportAction) ? ReportActionsUtils.getOriginalMessage(iouReportAction) : undefined;

const originalMessage = !isEmptyObject(iouReportAction) && ReportActionsUtils.isMoneyRequestAction(iouReportAction) ? ReportActionsUtils.getOriginalMessage(iouReportAction) : undefined;

@mountiny mountiny added External Added to denote the issue can be worked on by a contributor Daily KSv2 and removed DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jun 24, 2024
@melvin-bot melvin-bot bot changed the title Split - 1:1 DMs are not instantly created when splitting expense (compared to prod) [$250] Split - 1:1 DMs are not instantly created when splitting expense (compared to prod) Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

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

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

melvin-bot bot commented Jun 24, 2024

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

@mountiny
Copy link
Contributor

I dont think this has to be a blocker, the DMs appear eventually. @ZhenjaHorbach can you please review @bernhardoj proposal?

@ZhenjaHorbach
Copy link
Contributor

I dont think this has to be a blocker, the DMs appear eventually. @ZhenjaHorbach can you please review @bernhardoj proposal?

Yes, sure
I'll do it within 30 minutes

@ZhenjaHorbach
Copy link
Contributor

@bernhardoj

Thanks for the proposal
Your decision makes sense to me !

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 24, 2024

Current assignee @marcochavezf is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@ralyodio
Copy link

It only takes about 1-2 seconds for me to show the DMs.

Copy link

melvin-bot bot commented Jun 24, 2024

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

@marcochavezf
Copy link
Contributor

Sounds good, thanks for the review @ZhenjaHorbach, assigning @bernhardoj 🚀

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

📣 @ZhenjaHorbach 🎉 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

Copy link

melvin-bot bot commented Jun 24, 2024

📣 @bernhardoj 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 25, 2024
@bernhardoj
Copy link
Contributor

PR is ready
cc: @ZhenjaHorbach

@abekkala
Copy link
Contributor

PR Deployed to Staging Jun 25

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title [$250] Split - 1:1 DMs are not instantly created when splitting expense (compared to prod) [HOLD for payment 2024-07-10] [$250] Split - 1:1 DMs are not instantly created when splitting expense (compared to prod) Jul 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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

Copy link

melvin-bot bot commented Jul 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-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-07-10. 🎊

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

Copy link

melvin-bot bot commented Jul 3, 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:

  • [@ZhenjaHorbach] The PR that introduced the bug has been identified. Link to the PR:
  • [@ZhenjaHorbach] 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:
  • [@ZhenjaHorbach] 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:
  • [@ZhenjaHorbach] Determine if we should create a regression test for this bug.
  • [@ZhenjaHorbach] 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.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abekkala
Copy link
Contributor

abekkala commented Jul 8, 2024

PAYMENT SUMMARY FOR JUL 10

@bernhardoj
Copy link
Contributor

I will request the payment through ND when the payout time is due.

@bernhardoj
Copy link
Contributor

Requested in ND

@abekkala
Copy link
Contributor

@bernhardoj ah yes, you get paid in ND now. I've ended the Upwork contract for you. Thank you! 🎉

@ZhenjaHorbach payment sent and contract ended - thank you! 🎉

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@ZhenjaHorbach
Copy link
Contributor

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:

  • [@ZhenjaHorbach] The PR that introduced the bug has been identified. Link to the PR:

#40168

  • [@ZhenjaHorbach] 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:

https://github.com/Expensify/App/pull/40168/files#r1672563994

  • [@ZhenjaHorbach] 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:

NA

  • [@ZhenjaHorbach] Determine if we should create a regression test for this bug.
  • [@ZhenjaHorbach] 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.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

Regression Test Proposal

  1. Make sure Priority Mode is set to Most recent
  2. Split expense with users you never chat before
  3. Verify the user DMs are created and shown immediately in LHN

Do we agree 👍 or 👎

@ZhenjaHorbach
Copy link
Contributor

Sorry for delay 😅

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. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants