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 - MIROSLAV ONLY] [$1000] Web - Offline - Deleted workspace still shows in the create room dropdown #22745

Closed
1 of 6 tasks
kbecciv opened this issue Jul 12, 2023 · 31 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 Monthly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 12, 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. Create a new workspace
  2. Force Offline mode
  3. Go workspace detail of above workspace
  4. Click three dot => Delete workspace
  5. Click FAB button
  6. Click New room, observe that the workspace just created above is still in the dropdown

Expected Result:

Workspaces deleted when offline should not be displayed in the dropdown

Actual Result:

Workspaces deleted when offline are still displayed in the dropdown and can be selected

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.38-3
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

Screen.Recording.2023-07-08.at.09.25.30.mov

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015b5a6ced3dfb0dd7
  • Upwork Job ID: 1679308786376093696
  • Last Price Increase: 2023-07-13
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Jul 12, 2023

Proposal

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

Workspaces deleted when offline should not be displayed in the dropdown

What is the root cause of that problem?

The reason is that after deleting the workspace in offline mode, it will update pendingAction = 'delete' in optimisticData.
But in the dropdown we have not filtered the workspaces with pendingAction = 'delete'

// Workspaces are policies with type === 'free'
const workspaceOptions = useMemo(
() =>
_.map(
_.filter(props.policies, (policy) => policy && policy.type === CONST.POLICY.TYPE.FREE),
(policy) => ({label: policy.name, key: policy.id, value: policy.id}),
),
[props.policies],
);

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

We add the condition not to display the workspaces with pendingAction = 'delete'

 _.filter(props.policies, (policy) => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE),

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

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

@jliexpensify
Copy link
Contributor

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 13, 2023
@melvin-bot melvin-bot bot changed the title Web - Offline - Deleted workspace still shows in the create room dropdown [$1000] Web - Offline - Deleted workspace still shows in the create room dropdown Jul 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 13, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015b5a6ced3dfb0dd7

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

melvin-bot bot commented Jul 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 13, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Jul 13, 2023

Proposal

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

  1. Workspaces deleted when offline are still displayed in the dropdown and can be selected.

While investigating this, I also see 2 more related issues that I believe should be fixed together here (if not I'm happy to report them as separate bugs):
2. In offline mode, all workspaces are deleted, but the "New workspace" option does not show when clicking Floating green button
3. All workspaces are deleted in offline mode but there's still the "New room" option in the FloatingButton (there shouldn't be because there's no workspace to select)

What is the root cause of that problem?

  1. In here, we're not filtering out deleted workspaces before displaying the options
  2. In here, we're using the .pendingAction of the policy to check if it's active or not, however in here, we're not including pendingAction in the fields to provide to the component, so it's always undefined when the hasActiveFreePolicy check is run, leading to deleted workspace being counted as 'active'
  3. In here, we're not filtering out deleted workspaces before using its length here to decide if we want to show the New room option.

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

  1. We should create a getActivePolicies util in PolicyUtils to filter out the active policies, which will exclude the pending delete policies
function getActivePolicies(policies) {
    return _.filter(policies, (policy) => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
}

Then use the util here to filter
2. We should include pendingAction field here

pendingAction: policy.pendingAction,
  1. We should use the getActivePolicies util to filter here as well

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Jul 17, 2023

@namhihi237 proposed first but I prefer @tienifr's proposal as they researched more time finding all similar issues and proposed general solution.
Assigned engineer will give the final call.
🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@amyevans
Copy link
Contributor

Agreed the generalized solution is best here, thanks all! Assigning @tienifr

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

melvin-bot bot commented Jul 17, 2023

📣 @0xmiroslav We're missing your Upwork ID to automatically send you an offer for the Reviewer role.
Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

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 Jul 17, 2023

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

Upwork job

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Jul 21, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Offline - Deleted workspace still shows in the create room dropdown [HOLD for payment 2023-07-28] [$1000] Web - Offline - Deleted workspace still shows in the create room dropdown Jul 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 21, 2023

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

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:

  • @0xmiroslav requires payment
  • @tienifr requires payment

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 Jul 21, 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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] 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.
  • [@jliexpensify] 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 Jul 27, 2023
@jliexpensify
Copy link
Contributor

jliexpensify commented Jul 31, 2023

Payments:

  • Bug Reporter: @namhihi237 $250
  • Contributor: @tienifr $1000 + $500 (bonus) = $1500
  • C+: @0xmiroslav $1000 + $500 (bonus) = $1500

Upworks job is here.

Bump @0xmiroslav - I can't pay until the checklist is completed

@jliexpensify
Copy link
Contributor

Bump @0xmiroslav to complete the checklist so everyone can be paid, thanks!

@jliexpensify
Copy link
Contributor

Bump @0xmiroslav for the checklist!

@melvin-bot melvin-bot bot added the Overdue label Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

@amyevans, @jliexpensify, @0xmiroslav, @tienifr Eep! 4 days overdue now. Issues have feelings too...

@amyevans
Copy link
Contributor

amyevans commented Aug 8, 2023

Bumped in Slack

@melvin-bot melvin-bot bot removed the Overdue label Aug 8, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Aug 8, 2023

No PRs caused regression. We didn't consider offline pending deletion during initial implementation of create room dropdown.

For regression test, I suggest to add offline pending deletion case in Testrail for

  • "New room" option visibility in FAB menu
  • "New workspace" option visibility in FAB menu (I'm heard that this option will be deprecated)
  • workspaces dropdown selection in new room page

@jliexpensify
Copy link
Contributor

@0xmiroslav can you please write out the proposed Regression Steps? Thanks.

@0xmiros
Copy link
Contributor

0xmiros commented Aug 9, 2023

Regression Test Proposal

  1. Create new account
  2. Create a new workspace A
  3. Create a new workspace B
  4. Force offline mode
  5. Go to workspace detail of A
  6. Click three dot > Delete workspace
  7. Click FAB > New room button
  8. Verify that the deleted workspace A is not displayed in the workspace dropdown selection
  9. Go to workspace detail of B
  10. Click three dot > Delete workspace
  11. Click FAB button
  12. Verify that the New room button is not displayed
  13. Verify that the New workspace button is displayed

@jliexpensify
Copy link
Contributor

Just hired @0xmiroslav , once he accepts I'll issue payment.

@namhihi237 - Can you please update your GH name to reflect the same name in Upworks? Thanks.

@namhihi237
Copy link
Contributor

@jliexpensify updated

@0xmiros
Copy link
Contributor

0xmiros commented Aug 9, 2023

can you please hold my payment until further notice? I am working on some stuff due to recent measurements in my region. And update issue to Monthly. Same applies to any other issues I am assigned. Thanks

@jliexpensify
Copy link
Contributor

jliexpensify commented Aug 10, 2023

@0xmiroslav I've sent you an email, please check your Gmail Inbox.

@namhihi237 and @tienifr sorry for the delay here, I am paying you both now!

EDIT: Paid Nam and Tien. Moving to monthly while we discuss next steps with Miroslav.

@jliexpensify jliexpensify added Monthly KSv2 and removed Daily KSv2 labels Aug 10, 2023
@jliexpensify jliexpensify changed the title [HOLD for payment 2023-07-28] [$1000] Web - Offline - Deleted workspace still shows in the create room dropdown [HOLD for payment - MIROSLAV ONLY] [$1000] Web - Offline - Deleted workspace still shows in the create room dropdown Aug 10, 2023
@jliexpensify
Copy link
Contributor

jliexpensify commented Aug 16, 2023

Ok, have resolved payment issues via email with Miroslav.

Have asked Miroslav to pass on the GH to his friend to apply (we've never hired him so can't find him in Upworks or invite him).

@jliexpensify
Copy link
Contributor

Sorted out payment for Miroslav, closing!

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 Monthly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants