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

[PAID] [$500] Workspace - Unable to remove error reported member #26339

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 30, 2023 · 52 comments
Closed
1 of 6 tasks

[PAID] [$500] Workspace - Unable to remove error reported member #26339

lanitochka17 opened this issue Aug 30, 2023 · 52 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

@lanitochka17
Copy link

lanitochka17 commented Aug 30, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Tap profile icon
  3. Tap workspace
  4. Tap any created workspace
  5. Tap members
  6. Tap invite
  7. Tap any invalid number
  8. Tap invite
  9. Tap on close button in workspace members page
  10. Select error reported member and tap remove
  11. Tap confirm Remove
  12. Navigate back to general settings page
  13. Refresh page
  14. Tap workspace
  15. Tap members

Expected Result:

The workspace members page must not display error reported member which is removed

Actual Result:

The workspace members page displays removed error reported member again after refreshing the page

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.59

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6183139_remove.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011d44b0b1f472370a
  • Upwork Job ID: 1699206903663333376
  • Last Price Increase: 2023-09-05
  • Automatic offers:
    • jjcoffee | Reviewer | 26546537
    • tienifr | Contributor | 26546540
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 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

@strepanier03
Copy link
Contributor

strepanier03 commented Sep 1, 2023

Hmmm, I do not have the same experience when trying to repro this.

Following the steps from the recording on Android/Chrome (Pixel 6), I do not have the option to select an invalid phone number at all. I tried entering just "84" as the video and I have to enter a full phone number to be able to select anything. When I do, the number is valid and I don't get the error report as described.

@strepanier03 strepanier03 added the Needs Reproduction Reproducible steps needed label Sep 1, 2023
@strepanier03
Copy link
Contributor

@lanitochka17 - Anything different in your setup that isn't covered in the bug report? Can you still repro?

@lanitochka17
Copy link
Author

Issue reproducible on Build 1.3.62-2
Please try again with invalid number +84566123455

Screenshot_20230903-215141_Chrome

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@strepanier03
Copy link
Contributor

Okay finally got it, thanks @lanitochka17.

I was able to repro just fine using the new number you provided. Moving on.

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@strepanier03 strepanier03 added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Sep 5, 2023
@melvin-bot melvin-bot bot changed the title Workspace - Unable to remove error reported member [$500] Workspace - Unable to remove error reported member Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011d44b0b1f472370a

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

melvin-bot bot commented Sep 5, 2023

Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Sep 6, 2023

Proposal

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

Workspace - Unable to remove error reported member

What is the root cause of that problem?

Firstly,

In

const dismissError = useCallback(
(item) => {
if (item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
Policy.clearDeleteMemberError(props.route.params.policyID, item.accountID);
} else {
Policy.clearAddMemberError(props.route.params.policyID, item.accountID);
}
},
[props.route.params.policyID],
);

we use item.accountID to get the accountID, but we did not pass it to result

Secondly,

In

function clearAddMemberError(policyID, accountID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`, {
[accountID]: null,
});
Onyx.merge(`${ONYXKEYS.PERSONAL_DETAILS_LIST}`, {
[accountID]: null,
});
}

we use [accountID]: null, it will be ignore in Onyx.merge method

https://github.com/Expensify/react-native-onyx/blob/d03c2a316db0c9dc8b600f21ef3222cc6a8b1b67/lib/Onyx.js#L1081

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

Firstly, we need to add accountID to result

            result.push({
                keyForList: accountID,
                accountID: accountID, // add this line
...

Secondly, we need to change [accountID]: null in

function clearAddMemberError(policyID, accountID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`, {
[accountID]: null,
});
Onyx.merge(`${ONYXKEYS.PERSONAL_DETAILS_LIST}`, {
[accountID]: null,
});
}

to

        [accountID]: {
            pendingAction: null,
            errors: null,
        },

like what we did in clearDeleteMemberError function

Result

Screen.Recording.2023-09-06.at.19.21.11.mov

@bernhardoj
Copy link
Contributor

Proposal

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

We can't remove failed-to-add workspace members.

What is the root cause of that problem?

There are 2 issues.

First, to delete a user from the workspace member list, we need the accountID. However, the member list does not have accountID property, instead, it has a keyForList property which has a value of the accountID.

const dismissError = useCallback(
(item) => {
if (item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
Policy.clearDeleteMemberError(props.route.params.policyID, item.accountID);
} else {
Policy.clearAddMemberError(props.route.params.policyID, item.accountID);
}
},
[props.route.params.policyID],
);

result.push({
keyForList: accountID,

Second, even if we pass the correct account ID, the member is never deleted from Onyx. In Policy.clearAddMemberError, we already set the member data to null to clear it.

function clearAddMemberError(policyID, accountID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`, {
[accountID]: null,
});
Onyx.merge(`${ONYXKEYS.PERSONAL_DETAILS_LIST}`, {
[accountID]: null,
});
}

However, we currently have an issue where setting null as the value won't really clear it from the Onyx.

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

  1. Pass the correct accountID by using item.keyForList here.
    const dismissError = useCallback(
    (item) => {
    if (item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
    Policy.clearDeleteMemberError(props.route.params.policyID, item.accountID);
    } else {
    Policy.clearAddMemberError(props.route.params.policyID, item.accountID);
    }
    },
    [props.route.params.policyID],
    );
  2. Wait for the Onyx issue to be resolved.

@jjcoffee
Copy link
Contributor

jjcoffee commented Sep 7, 2023

Happy to go with @tienifr's proposal. The RCA is correct and the solution makes sense. I think we can just use the existing keyForList property rather than adding a new accountID one.

@bernhardoj's proposal is almost the same, except they propose to wait for the Onyx issue to be resolved, which we don't have a timeline for so it makes sense to just fix now. We also already do the same here:

function clearDeleteMemberError(policyID, accountID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`, {
[accountID]: {
pendingAction: null,
errors: null,
},
});
}

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@dangrous
Copy link
Contributor

dangrous commented Sep 7, 2023

Yep, I agree with that, I'll assign you @tienifr!

Just to confirm, once that Onyx issue IS fixed, will we need any modifications to this code, or will this work as expected? I think it will be fine, but wanted a second opinion.

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

melvin-bot bot commented Sep 7, 2023

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

@jjcoffee
Copy link
Contributor

Ah great find, thanks! I think we can hold on Expensify/react-native-onyx#359 then cc @dangrous

@dangrous dangrous changed the title [Hold React-Native-Onyx#333][$500] Workspace - Unable to remove error reported member [Hold React-Native-Onyx#359][$500] Workspace - Unable to remove error reported member Sep 22, 2023
@chrispader
Copy link
Contributor

Ah great find, thanks! I think we can hold on Expensify/react-native-onyx#359 then cc @dangrous

#359 got merged :)

@tienifr
Copy link
Contributor

tienifr commented Sep 26, 2023

I'll re-test soon

@dangrous
Copy link
Contributor

Sweet! @tienifr can you test react-native-onyx 1.0.89 in your PR and see how it goes?

@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 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 @tienifr got assigned: 2023-09-07 14:26:44 Z
  • when the PR got merged: 2023-09-28 02:44:13 UTC
  • days elapsed: 14

On to the next one 🚀

@dangrous dangrous changed the title [Hold React-Native-Onyx#359][$500] Workspace - Unable to remove error reported member [$500] Workspace - Unable to remove error reported member Sep 29, 2023
@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 2, 2023
@melvin-bot melvin-bot bot changed the title [$500] Workspace - Unable to remove error reported member [HOLD for payment 2023-10-09] [$500] Workspace - Unable to remove error reported member Oct 2, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-09. 🎊

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 - Internal - N/A
  • Contributor that fixed the issue - @tienifr - $500 + $250 (speed bonus) = $750
  • Contributor+ that helped on the issue and/or PR - @jjcoffee - $500 + $250 (speed bonus) = $750

Speed Bonus Analysis: The PR was originally created with the intention of a temporary fix until Onyx changes were done but very shortly after assigning we learned the ONyx changes were going to be put through much quicker than expected. The PR got put on hold right away for that reason. Assessing the timeline the Contributor and C+ both acted with urgency and very quickly prior to and after the hold.

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 2, 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:

  • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR: N/A - this was a known issue
  • [@jjcoffee] 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: N/A
  • [@jjcoffee] 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 - it came from an Onyx update so hard to catch
  • [@jjcoffee] Determine if we should create a regression test for this bug. - Yes
  • [@jjcoffee] 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.
  • [@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/325034

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

@tienifr - I have paid you via Upwork and closed the contract!

@jjcoffee - I will keep an eye open for the checklist items and handle the regression test as needed. Once that's done I'll pay you via Upwork as well.

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: N/A - this was a known issue
  • 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: N/A
  • 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 - it came from an Onyx update so hard to catch
  • Determine if we should create a regression test for this bug. Yes
  • 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. See below

@jjcoffee
Copy link
Contributor

Regression test proposal

  1. On any workspace, invite a member with an invalid number, e.g. +84566123459@expensify.sms
  2. Select the error reported member and remove
  3. Navigate back to general settings page
  4. Refresh the page
  5. Go back to the workspace members list and verify that the member is removed

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@strepanier03 Checklist complete - sorry for the delay! Also, I think this may be due the timeliness bonus as we ended up needing to hold for a react-native-onyx update. After that update came, our PR was merged within 3WD.

@strepanier03
Copy link
Contributor

strepanier03 commented Oct 11, 2023

@jjcoffee - No worries on the checklist, we're all busy and it was done pretty quickly still anyway.

Thanks for the heads-up on the Onyx changes. I'll review the timeline and update the payment post with a final determination. If we apply the bonus, I'll add an additional payment for the contributor as well to make things square.

Will update you soon!

@strepanier03
Copy link
Contributor

Timeline:

  • contributor assigned 2023-09-07
  • comment from C+ about placing PR on hold 2023-09-12
  • contributor bumped for review 2023-09-26
  • C+ requested review from Expensify 2023-09-27
  • Expensify merged 2023-09-27

@jjcoffee - Can you give me some context regarding when the PR was first put on hold? Was it created under the assumption it would be on hold right away because of the Onyx work? I think that it was likely before 2023-09-12 when a hold comment was left on the PR. If that's the case I want to consider that in my review.

Thanks!

@jjcoffee
Copy link
Contributor

@strepanier03 Sure! We actually thought the Onyx fix would take a while to come together so the plan was to add a temporary fix in the PR and then revert once the Onyx change was ready. Those Onyx changes came earlier than expected so we didn't need that initial workaround PR in the end and just decided to hold until the Onyx changes got merged.

@strepanier03
Copy link
Contributor

Thank you so much for that context. I'm going to update this for the urgency bonus and appreciate you raising it and discussing it with me.

I'll finish updating this now.

@strepanier03
Copy link
Contributor

All right, this is all done.

I've updated the payment for @tienifr to include the speed bonus and paid out @jjcoffee as well.

Thank you both for the hard work you've done and the fantastic communication. You're both great members of the community and I enjoyed working with you.

@strepanier03 strepanier03 changed the title [HOLD for payment 2023-10-09] [$500] Workspace - Unable to remove error reported member [PAID] [$500] Workspace - Unable to remove error reported member Oct 12, 2023
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

8 participants