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-02-05] [$500] Workspace avatar not reverted to default when deleting workspace offline #32195

Closed
3 of 6 tasks
lanitochka17 opened this issue Nov 29, 2023 · 39 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 Nov 29, 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!


Version Number: 1.4.5-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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open the app
  2. Disable internet connection
  3. Create a workspace
  4. Upload an avatar for workspace
  5. Navigate to #admins room
  6. Tap the header > workspace header
  7. Delete the workspace
  8. Navigate to #admins room

Expected Result:

Admin room avatar is reverted to the default one

Actual Result:

Admin room avatar is not reverted to default, it is still a custom one

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

Bug6294748_1701272122743.video_2023-11-29_09-52-45.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0194502a9c1a9e4e7e
  • Upwork Job ID: 1729899324299497472
  • Last Price Increase: 2023-11-29
  • Automatic offers:
    • getusha | Reviewer | 27987317
    • FitseTLT | Contributor | 27987320
@lanitochka17 lanitochka17 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 Nov 29, 2023
@melvin-bot melvin-bot bot changed the title Workspace avatar not reverted to default when deleting workspace offline [$500] Workspace avatar not reverted to default when deleting workspace offline Nov 29, 2023
Copy link

melvin-bot bot commented Nov 29, 2023

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

Copy link

melvin-bot bot commented Nov 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0194502a9c1a9e4e7e

Copy link

melvin-bot bot commented Nov 29, 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

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

melvin-bot bot commented Nov 29, 2023

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

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 29, 2023

Proposal

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

Workspace avatar not reverted to default when deleting workspace offline

What is the root cause of that problem?

We are not resetting the workspace avatar in onyx optimisticData here

function deleteWorkspace(policyID, reports, policyName) {
const filteredPolicies = filter(allPolicies, (policy) => policy.id !== policyID);
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
errors: null,
},
},

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

We need to reset the workspace avatar in optimisticData here

function deleteWorkspace(policyID, reports, policyName) {
const filteredPolicies = filter(allPolicies, (policy) => policy.id !== policyID);
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
errors: null,
},
},

change it to

function deleteWorkspace(policyID, reports, policyName) {
    const filteredPolicies = filter(allPolicies, (policy) => policy.id !== policyID);
    const optimisticData = [
        {
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
            value: {
                pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
                avatar: '',
                errors: null,
            },
        },

What alternative solutions did you explore? (Optional)

@yh-0218
Copy link
Contributor

yh-0218 commented Nov 29, 2023

Proposal

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

Workspace avatar not reverted to default when deleting workspace offline

What is the root cause of that problem?

When we get workspace avatar, we didn't consider pendingAction here.

const policyExpenseChatAvatarSource = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar

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

We need to consider pendingAction to get workspace avatar.

const policyExpenseChatAvatarSource = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar &&
    allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE
        ? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar
        : getDefaultWorkspaceAvatar(workspaceName);

What alternative solutions did you explore? (Optional)

@getusha
Copy link
Contributor

getusha commented Dec 3, 2023

@FitseTLT why do we need to remove other values from

value: {
stateNum,
statusNum,
hasDraft,
oldPolicyName,
},

and replace it with only avatar value? are you referring to adding the avatar or replacing the previous value with it.

@melvin-bot melvin-bot bot removed the Overdue label Dec 3, 2023
@FitseTLT
Copy link
Contributor

FitseTLT commented Dec 3, 2023 via email

@FitseTLT
Copy link
Contributor

FitseTLT commented Dec 3, 2023

@FitseTLT why do we need to remove other values from

value: {
stateNum,
statusNum,
hasDraft,
oldPolicyName,
},

and replace it with only avatar value? are you referring to adding the avatar or replacing the previous value with it.

@getusha I am using Onyx.METHOD.MERGE not Onyx.METHOD.SET so I am replacing only the value of the avatar (resetting it to '') of the policy 👍

@melvin-bot melvin-bot bot added the Overdue label Dec 6, 2023
@getusha
Copy link
Contributor

getusha commented Dec 6, 2023

Thanks for the proposal, @FitseTLT. I agree that we should reset the optimistic data. The proposal from @FitseTLT looks good to me and works well.

🎀 👀 🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2023
Copy link

melvin-bot bot commented Dec 6, 2023

Triggered auto assignment to @madmax330, 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 Dec 6, 2023
Copy link

melvin-bot bot commented Dec 6, 2023

📣 @getusha 🎉 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 Dec 6, 2023

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

@getusha
Copy link
Contributor

getusha commented Dec 8, 2023

@FitseTLT any update on the PR?

@FitseTLT
Copy link
Contributor

FitseTLT commented Dec 8, 2023

Will make PR ready tomorrow.

Copy link

melvin-bot bot commented Jan 5, 2024

This issue has not been updated in over 15 days. @madmax330, @FitseTLT, @muttmuure, @getusha eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@getusha
Copy link
Contributor

getusha commented Jan 6, 2024

@madmax330 could you please check this? #32986 (comment)

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Jan 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Workspace avatar not reverted to default when deleting workspace offline [HOLD for payment 2024-02-05] [$500] Workspace avatar not reverted to default when deleting workspace offline Jan 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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

Copy link

melvin-bot bot commented Jan 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.32-5 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-02-05. 🎊

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

Copy link

melvin-bot bot commented Jan 29, 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:

  • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
  • [@getusha] 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:
  • [@getusha] 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:
  • [@getusha] Determine if we should create a regression test for this bug.
  • [@getusha] 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:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 5, 2024
@getusha
Copy link
Contributor

getusha commented Feb 6, 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:

[@getusha] The PR that introduced the bug has been identified. Link to the PR: it is an edge case left unhandled.
[@getusha] 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
[@getusha] 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
[@getusha] Determine if we should create a regression test for this bug. a minor issue, i don't think it is worth including it in test rail.
[@getusha] 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
Copy link
Contributor

Thanks @getusha - handling

@muttmuure
Copy link
Contributor

$500 - @getusha
$500 - @FitseTLT

@FitseTLT
Copy link
Contributor

FitseTLT commented Feb 8, 2024

The previous Upwork offer is still open. @muttmuure Do you prefer me to accept the offer you sent me today?

@muttmuure
Copy link
Contributor

Oh! For some reason I thought it was closed

@muttmuure
Copy link
Contributor

Yep, seeing "this post is closed and is no longer accepting proposals."

@muttmuure
Copy link
Contributor

Sorry it means I need to send out a new offer

@muttmuure
Copy link
Contributor

Can you accept that one and I'll pay it?

@FitseTLT
Copy link
Contributor

FitseTLT commented Feb 9, 2024

Accepted

@muttmuure
Copy link
Contributor

I've been looking around and I can see that I could have paid you through the "All Contracts" page - I'll know for next time!

@muttmuure
Copy link
Contributor

@getusha I've invited you to a payment issue

@getusha
Copy link
Contributor

getusha commented Feb 9, 2024

@muttmuure accepted.

@melvin-bot melvin-bot bot added the Overdue label Feb 12, 2024
@muttmuure
Copy link
Contributor

OK offer sent

@melvin-bot melvin-bot bot removed the Overdue label Feb 12, 2024
@getusha
Copy link
Contributor

getusha commented Feb 12, 2024

@muttmuure accented the offer.

@muttmuure
Copy link
Contributor

Paid

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

6 participants