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-03-26] [$500] Members - After removing the error of adding a member to WS, the red dot remains in the RHN #34852

Closed
6 tasks done
kbecciv opened this issue Jan 20, 2024 · 55 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 Needs Reproduction Reproducible steps needed

Comments

@kbecciv
Copy link

kbecciv commented Jan 20, 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: 1.4.28-0
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:

  1. Open https://staging.new.expensify.com/
  2. Log in under your HT account
  3. Create a new WS
  4. Navigate to the WS settings
  5. Click the Members tab
  6. Invite a user with a VOIP or landline
  7. If required, delete the add Members error message
  8. Return to the WS settings menu

Expected Result:

After removing the error of adding a member to WS, the red dot should disappear

Actual Result:

After removing the error of adding a member to WS, the red dot remains in the RHN

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

Add any screenshot/video evidence

Bug6348407_1705733236808.Recording__1121.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015688669ede8e962b
  • Upwork Job ID: 1748730789626449920
  • Last Price Increase: 2024-02-28
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 20, 2024
@melvin-bot melvin-bot bot changed the title Members - After removing the error of adding a member to WS, the red dot remains in the RHN [$500] Members - After removing the error of adding a member to WS, the red dot remains in the RHN Jan 20, 2024
Copy link

melvin-bot bot commented Jan 20, 2024

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

Copy link

melvin-bot bot commented Jan 20, 2024

Job added to Upwork: https://www.upwork.com/jobs/~015688669ede8e962b

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

melvin-bot bot commented Jan 20, 2024

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

@kbecciv
Copy link
Author

kbecciv commented Jan 20, 2024

We think that this bug might be related to #wave6-collect-submitters
CC @greg-schroeder

@bernhardoj
Copy link
Contributor

bernhardoj commented Jan 20, 2024

Proposal

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

When adding a member that will gives an error, the member is hidden from the list.

What is the root cause of that problem?

The member will not be included in the list if the personal detail is missing.

if (!details) {
Log.hmmm(`[WorkspaceMembersPage] no personal details found for policy member with accountID: ${accountID}`);
return;
}

When we add a new member, we will add a new optimistic personal detail.

function getNewPersonalDetailsOnyxData(logins: string[], accountIDs: number[]): Required<Pick<OnyxData, 'optimisticData' | 'finallyData'>> {
const personalDetailsNew: PersonalDetailsList = {};
const personalDetailsCleanup: PersonalDetailsList = {};
logins.forEach((login, index) => {
const accountID = accountIDs[index];
if (allPersonalDetails && Object.keys(allPersonalDetails?.[accountID] ?? {}).length === 0) {
personalDetailsNew[accountID] = {
login,
accountID,
avatar: UserUtils.getDefaultAvatarURL(accountID),
displayName: LocalePhoneNumber.formatPhoneNumber(login),
};
/**
* Cleanup the optimistic user to ensure it does not permanently persist.
* This is done to prevent duplicate entries (upon success) since the BE will return other personal details with the correct account IDs.
*/
personalDetailsCleanup[accountID] = null;
}
});
const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: personalDetailsNew,
},
];
const finallyData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: personalDetailsCleanup,
},
];
return {
optimisticData,
finallyData,
};
}

And we add a finallyData that will be merged whether it fails or success to clear the optimistic personal detail. When fail, we lost the optimistic personal detail, thus the member is hidden.

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

Don't use. finally data to clear the optimistic personal detail, but use success data

then we will update the usage of getNewPersonalDetailsOnyxData in both addMembersToWorkspace and inviteToRoom

@Tony-MK
Copy link
Contributor

Tony-MK commented Jan 22, 2024

Proposal

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

Members - After removing the error of adding a member to WS, the red dot remains in the RHN

What is the root cause of that problem?

The purpose of finallyData is to clean up the newPersonalDetailsOnyxData set in the ${ONYXKEYS.COLLECTION.PERSONAL_DETAILS_LIST} collection because it might cause double personalDetails to be stored since the backend will either set nothing or new realistic data required for each new member.

/**
* Cleanup the optimistic user to ensure it does not permanently persist.
* This is done to prevent duplicate entries (upon success) since the BE will return other personal details with the correct account IDs.
*/
personalDetailsCleanup[accountID] = null;

The addMembersToWorkspace function creates the optimisticMembersState and failureMembersState in the ${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID} collection.

response

When a single member is non-existent, the onyxData response is an empty array, but the failureMembersState is set while the personalDetails is deleted.

// Convert to object with each key containing the error. We don’t
// need to remove the members since that is handled by onClose of OfflineWithFeedback.
value: failureMembersState,

Hence, failureMemberState is not deleted because it is expected to be deleted by the OfflineFeedback's onClose function when the admin dismisses the error.

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

Amend the failureMembersState to make sure that errors are not created and the pendingAction, from the optimisticMembersState, is erased from the ${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID} collection once the response from the AddMembersToWorkspace endpoint arrives.

failureMembersState[accountID] = {
errors: ErrorUtils.getMicroSecondOnyxError('workspace.people.error.genericAdd'),
};

Therefore, we should change the line above to be similar to the one below.

failureMembersState[accountID] = null;

Result

Result.mov

Note

I am theorizing that this is the correct solution since when testing the AddMembersToWorkspace endpoint by inviting a combination of existent and non-existent members in one request, the backend returned the same 404 response.

Hence, could I get confirmation of this behavior to rule out this solution?

@rushatgabhane
Copy link
Member

Isn't the issue that the error message isn't shown? So you can't dismiss it.

@bernhardoj
Copy link
Contributor

@rushatgabhane the member itself isn't shown, so the error message too.

Copy link

melvin-bot bot commented Jan 27, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jan 27, 2024
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Copy link

melvin-bot bot commented Jan 30, 2024

@rushatgabhane, @muttmuure Huh... This is 4 days overdue. Who can take care of this?

@muttmuure
Copy link
Contributor

Trying to reproduce now

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 31, 2024
Copy link

melvin-bot bot commented Feb 3, 2024

@rushatgabhane @muttmuure 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!

Copy link

melvin-bot bot commented Feb 3, 2024

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

Copy link

melvin-bot bot commented Feb 5, 2024

@rushatgabhane, @muttmuure Eep! 4 days overdue now. Issues have feelings too...

@muttmuure
Copy link
Contributor

Unable to reproduce this

@melvin-bot melvin-bot bot removed the Overdue label Feb 5, 2024
@bernhardoj
Copy link
Contributor

bernhardoj commented Feb 5, 2024

@muttmuure It's still reproducible. Notice the failed member is removed from the list but the red dot on the members menu is still showing.

Screen.Recording.2024-02-06.at.01.21.09.mov

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

PR is ready

cc: @rushatgabhane

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 19, 2024
@melvin-bot melvin-bot bot changed the title [$500] Members - After removing the error of adding a member to WS, the red dot remains in the RHN [HOLD for payment 2024-03-26] [$500] Members - After removing the error of adding a member to WS, the red dot remains in the RHN Mar 19, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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

Copy link

melvin-bot bot commented Mar 19, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.54-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 2024-03-26. 🎊

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

Copy link

melvin-bot bot commented Mar 19, 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:

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

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 26, 2024

  1. The PR that introduced the bug has been identified. Link to the PR: refactor: SelectionList multiple selection #22622

  2. 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: 717e22b#r140246790

  3. 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: N.A.

  4. Determine if we should create a regression test for this bug. No

  5. 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 - No

@rushatgabhane
Copy link
Member

@muttmuure could you please attach payment summary, thank you 🙇

@muttmuure muttmuure added Daily KSv2 and removed Weekly KSv2 labels Mar 27, 2024
@muttmuure
Copy link
Contributor

$500 for @rushatgabhane as C+
$500 for @bernhardoj as C

@JmillsExpensify
Copy link

$500 approved for @rushatgabhane

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 2, 2024
@bernhardoj
Copy link
Contributor

@muttmuure hi, I think I haven't received the payment yet. As mentioned by melvin here, the previous offer has an error, but I haven't received a manual offer yet. Can you please recheck it, please?

@muttmuure muttmuure reopened this Apr 2, 2024
@muttmuure
Copy link
Contributor

Can you see this offer? https://www.upwork.com/nx/wm/offer/101695651

@bernhardoj
Copy link
Contributor

Yes, I can see that one and accepted it.

@muttmuure
Copy link
Contributor

All paid up!

@bernhardoj
Copy link
Contributor

Thanks!

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 Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

9 participants