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 2023-10-24] [$500] Email not found in new workspace after adding as member, splitting bill, deleting old workspace. #29024

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

Comments

@m-natarajan
Copy link

m-natarajan commented Oct 6, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Create new account > Settings > Create workspace > Members > Add members (copy email for step 4)
  2. Go to Announcement > Plus sign > Split bill > Add numbers > Split bill
  3. Go to Workspace > Three dots > Delete workspace
  4. Go back to Settings > Create workspace > Members > Add members > Paste copied email into workspace

Expected Result:

Email should be found when searching for it in the newly created workspace.

Actual Result:

Email cannot be found when searching for it in the newly created workspace.

Workaround:

unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.73-9
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
Notes/Photos/Videos: Any additional supporting documentation

Recorder_06102023_123639.mp4
Screen.Recording.2023-10-06.at.2.31.20.AM.mov
Screen.Recording.2023-10-06.at.1.55.22.AM.mov
Screen.Recording.2023-10-06.at.1.52.45.AM.mov
Screen.Recording.2023-10-06.at.1.49.01.AM.mov
Screen.Recording.2023-10-06.at.1.43.45.AM.mov
Recording.11.mp4

Expensify/Expensify Issue URL:
Issue reported by: @tewodrosGirmaA
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696584062077569

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01045d4102dd433123
  • Upwork Job ID: 1710349407654047744
  • Last Price Increase: 2023-10-06
  • Automatic offers:
    • hoangzinh | Reviewer | 27135873
    • c3024 | Contributor | 27135874
    • tewodrosGirmaA | Reporter | 27135875
Issue OwnerCurrent Issue Owner: @peterdbarkerUK
Issue OwnerCurrent Issue Owner: @peterdbarkerUK
@m-natarajan m-natarajan added the External Added to denote the issue can be worked on by a contributor label Oct 6, 2023
@c3024
Copy link
Contributor

c3024 commented Oct 6, 2023

Proposal

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

Cannot invite a member X to a workspace B if X was added to a workspace A, then split a bill with X and then the workspace A is deleted.

What is the root cause of that problem?

When we create a split request this here

App/src/libs/actions/IOU.js

Lines 1060 to 1065 in a6d2f3e

} else {
const existingChatReport = ReportUtils.getChatByParticipants([accountID]);
isNewOneOnOneChatReport = !existingChatReport;
shouldCreateOptimisticPersonalDetails = isNewOneOnOneChatReport;
oneOnOneChatReport = existingChatReport || ReportUtils.buildOptimisticChatReport([accountID]);
}

checks if there is one to one chat report and if does not exists it sets shouldCreateOptimisticPersonalDetails to true even though a personal detail exists and this here
isOptimisticPersonalDetail: true,

sets isOptimisticPersonalDetail to true and subsequently through buildOnyxDataForMoneyRequest, the personal detail is set with field isOptimisticPersonalDetail to true.
This here

personalDetails: _.filter(personalDetailsOptions, (personalDetailsOption) => !personalDetailsOption.isOptimisticPersonalDetail),

does not show this optimistic personal detail and also no option is created because it already exists in personal details.

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

We need to check if the accountID already exists in the personal details and if it does we should not change shouldCreateOptimisticPersonalDetails to true.
So we can subscribe to personal details in IOU and add this

const personalDetailExists = _.has(allPersonalDetails, accountID)

here


and change these
shouldCreateOptimisticPersonalDetails = !existingSplitChatReport;

shouldCreateOptimisticPersonalDetails = isNewOneOnOneChatReport;

to

shouldCreateOptimisticPersonalDetails = !existingSplitChatReport && !personalDetailExists;
shouldCreateOptimisticPersonalDetails = isNewOneOnOneChatReport && !personalDetailExists;

What alternative solutions did you explore? (Optional)

We might consider changing the logic here

const existingChatReport = ReportUtils.getChatByParticipants([accountID]);

to include the accountID of current user when we get report by participants
or
have a function to check if there is a chat with this participant instead of checking if a report has all participants like the existing getChatbyParticipants

Result
showInviteMember.mov

@melvin-bot melvin-bot bot changed the title Email not found in new workspace after adding as member, splitting bill, deleting old workspace. [$500] Email not found in new workspace after adding as member, splitting bill, deleting old workspace. Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01045d4102dd433123

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

@hoangzinh Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Oct 10, 2023
@hoangzinh
Copy link
Contributor

Reviewing proposal. Btw @m-natarajan could you help to add "Bug" label to this issue in order to have a BZ member assigned to this issue? Thanks

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2023
@m-natarajan m-natarajan added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hoangzinh
Copy link
Contributor

@c3024 Thanks for your proposal. It looks good to me. Your proposal pointed out a correct RCA and the solution makes sense. We should only create an optimisticPersonalDetails during split bill if it does not exist.

Thus, I think we go with @c3024's proposal here #29024 (comment)

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 2023

📣 @hoangzinh 🎉 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
Copy link

melvin-bot bot commented Oct 11, 2023

📣 @c3024 🎉 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
Copy link

melvin-bot bot commented Oct 11, 2023

📣 @tewodrosGirmaA 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @c3024 got assigned: 2023-10-11 07:38:38 Z
  • when the PR got merged: 2023-10-16 14:03:34 UTC
  • days elapsed: 3

On to the next one 🚀

@hoangzinh
Copy link
Contributor

I think it's more fair for Contributors if this issue is considered for the speed bonus because the 1st round approval is within a half day. @c3024 and I quickly made & tested the PR as soon as possible.

Screenshot 2023-10-16 at 21 55 17

Screenshot 2023-10-16 at 21 54 29

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 17, 2023
@melvin-bot melvin-bot bot changed the title [$500] Email not found in new workspace after adding as member, splitting bill, deleting old workspace. [HOLD for payment 2023-10-24] [$500] Email not found in new workspace after adding as member, splitting bill, deleting old workspace. Oct 17, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 24, 2023
@peterdbarkerUK
Copy link
Contributor

Summarizing payouts for this issue:

Issue reporter: @tewodrosGirmaA $50

Contributor: @c3024 $750

Upwork Job

@peterdbarkerUK
Copy link
Contributor

@hoangzinh please complete the above checklist and I'll process your payment too!

@hoangzinh
Copy link
Contributor

hoangzinh commented Oct 24, 2023

BugZero Checklist:

@hoangzinh
Copy link
Contributor

Regression Test Proposal

  1. Create a workspace X
  2. Invite a user A to workspace X
  3. Go to #announce room of workspace X
  4. Split a bill in this room with the user A
  5. Delete the workspace X
  6. Create another workspace Y
  7. Go to the Invite page of workspace Y
  8. Verify that user A is shown in the options below the search input.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@hoangzinh, @peterdbarkerUK, @Gonals, @c3024 Huh... This is 4 days overdue. Who can take care of this?

@peterdbarkerUK
Copy link
Contributor

Thanks @hoangzinh - I noticed you skipped the PR Review Checklist discussion step. Could you help me understand if and when that step is required? (I've asked this internally too)

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@hoangzinh
Copy link
Contributor

Yeah, because I think it's not a straightforward bug. It's hard to catch kind of this bug from the beginning.

@peterdbarkerUK
Copy link
Contributor

Thanks @hoangzinh - I'm new to BZ and still learning how to handle the judgment call elements of instructions. And, candidly, trying to identify steps we can remove as unnecessary.

On that note of me not being very good yet:
image

seems to me this is an edge case we don't need to test for in TestRail. I should have done this step earlier and saved you some bureaucracy. Would you agree?

@hoangzinh
Copy link
Contributor

No worry @peterdbarkerUK.

seems to me this is an edge case we don't need to test for in TestRail

I feel it's not an edge case. In a workspace, we split the bill to some users, then we delete this workspace and create a new workspace, we would like to add previous users to this new workspace. I'm 50:50 on it.

what do you think? @c3024 @Gonals do you agree this issue is an edge case? Thanks

@c3024
Copy link
Contributor

c3024 commented Oct 31, 2023

"Deleting workspace A" is not a required step.

I think this is not an edge case bug.

As long as we split bill with a user (whose personal details are already returned from backend) with whom we don't have a one-to-one chat already, we will face this bug. And this user option does not appear in any option list because this is turned into an optimistic detail.

While this might not be a frequent flow, this flow can happen sometimes and this bug is a bit more than an edge case bug in my opinion.

@peterdbarkerUK
Copy link
Contributor

Yeah, I'd agree with that. In which case should the regression test be:

  1. Create a workspace X
  2. Invite a new user A to workspace X
  3. Go to #announce room of workspace X
  4. Split a bill in this room with the user A
  5. Create another workspace Y
  6. Go to the Invite page of workspace Y
  7. Verify that user A is shown in the options below the search input.

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@peterdbarkerUK
Copy link
Contributor

TR update proposed, thanks everyone!

@hoangzinh
Copy link
Contributor

@peterdbarkerUK let me know when the payment is processed for me in Upwork. Thanks

@peterdbarkerUK
Copy link
Contributor

Ugh, I lost that in the regression test uncertainty. I'm sorry. Payment sent!

Job closed

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

No branches or pull requests

5 participants