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-12-28] [$500] Desktop - WS Settings - Red dot appears after uploading a Workspace avatar when offline #32513

Closed
1 of 6 tasks
lanitochka17 opened this issue Dec 5, 2023 · 25 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 Dec 5, 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.8-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 the testing app
  2. Switch off the internet for the device
  3. Click on your avatar > Workspaces
  4. Select a workspace to upload an avatar
  5. Click on the avatar and upload a picture
  6. Click on Save

Expected Result:

No error should appear after uploading the WS avatar

Actual Result:

Red dot appears on the user avatar after uploading the workspace avatar when offline, though photo is uploaded successfully. No clear information given on the reason for the error
Red dot and error will be removed when user clicks on the 2nd Save button on WS settings modal. Issue does not happen when user is connected to internet

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

Bug6302263_1701803580383.scr1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0165681605c06818ea
  • Upwork Job ID: 1732118554945167360
  • Last Price Increase: 2023-12-05
  • Automatic offers:
    • fedirjh | Reviewer | 28054418
    • bernhardoj | Contributor | 28054419
@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 Dec 5, 2023
@melvin-bot melvin-bot bot changed the title Desktop - WS Settings - Red dot appears after uploading a Workspace avatar when offline [$500] Desktop - WS Settings - Red dot appears after uploading a Workspace avatar when offline Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0165681605c06818ea

Copy link

melvin-bot bot commented Dec 5, 2023

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

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

melvin-bot bot commented Dec 5, 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

Copy link

melvin-bot bot commented Dec 5, 2023

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

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 5, 2023

Proposal

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

Updating the workspace avatar shows an RBR.

What is the root cause of that problem?

When we update a workspace avatar, we optimistically set the errorFields property with a value of {avatar: null}.

errorFields: {
avatar: null,
},

We show the RBR if there is a errorFields.

function getPolicyBrickRoadIndicatorStatus(policy: OnyxEntry<Policy>, policyMembersCollection: OnyxCollection<PolicyMembers>): string {
const policyMembers = policyMembersCollection?.[`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policy?.id}`] ?? {};
if (hasPolicyMemberError(policyMembers) || hasCustomUnitsError(policy) || hasPolicyErrorFields(policy)) {
return CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
}
return '';
}

function hasPolicyErrorFields(policy: OnyxEntry<Policy>): boolean {
return Object.keys(policy?.errorFields ?? {}).some((fieldErrors) => Object.keys(fieldErrors ?? {}).length > 0);
}

But currently, the way we check it is by checking if errorFields contains any key which is always true in our case.

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

We should check if the errorFields value contains a valid value, that is an object, not a null. To fix it, we should change the first Object.keys to Object.values

-return Object.keys(policy?.errorFields ?? {}).some((fieldErrors) => Object.keys(fieldErrors ?? {}).length > 0);
+return Object.values(policy?.errorFields ?? {}).some((fieldErrors) => Object.keys(fieldErrors ?? {}).length > 0);

this issue happens after the TS migration.

@fedirjh
Copy link
Contributor

fedirjh commented Dec 5, 2023

@bernhardoj Proposal looks good to me.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 5, 2023

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

@aimane-chnaif
Copy link
Contributor

Not able to reproduce on main

@jliexpensify
Copy link
Contributor

@aimane-chnaif I can repro on Staging:

image

Red dot and error will be removed when user clicks on the 2nd Save button on WS settings modal.

@lanitochka17 I don't think this is clearly written. From what I see, when you go back online, the red dot doesn't disappear, so you have to then re-save the WS image to have it disappear.

I'd personally expect the Save to apply automatically when you go back online, therefore making the red dot disappear (i.e. no need to re-save)

@jliexpensify
Copy link
Contributor

I'm on v1.4.10-0 and can't repro anymore. Please comment with a video if you can repro on this version @bernhardoj

@bernhardoj
Copy link
Contributor

@jliexpensify hi, I can still reproduce it on 1.4.10-0. Make sure you update the avatar while offline.

Screen.Recording.2023-12-08.at.14.28.40.mov

@mallenexpensify
Copy link
Contributor

Reopening for 👀 since @bernhardoj can reproduce and I might have reported a similar issue.
#32418 (comment)

@jliexpensify
Copy link
Contributor

Thanks @mallenexpensify - we can handle in this GH and you can close yours as a dupe?

@stitesExpensify bump for proposal review!

@mallenexpensify
Copy link
Contributor

I'll put mine on hold to ensure that the fix here fixes mine too. Thx

@stitesExpensify
Copy link
Contributor

@bernhardoj proposal lgtm

@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Overdue labels Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

📣 @fedirjh 🎉 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 13, 2023

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

@bernhardoj
Copy link
Contributor

PR is ready

cc: @fedirjh

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 21, 2023
@melvin-bot melvin-bot bot changed the title [$500] Desktop - WS Settings - Red dot appears after uploading a Workspace avatar when offline [HOLD for payment 2023-12-28] [$500] Desktop - WS Settings - Red dot appears after uploading a Workspace avatar when offline Dec 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

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

Copy link

melvin-bot bot commented Dec 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.14-6 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-12-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:

Copy link

melvin-bot bot commented Dec 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:

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

Hi @fedirjh can you complete the checklist before payment is issued tomorrow? Thanks in advance!

@fedirjh
Copy link
Contributor

fedirjh commented Dec 28, 2023

BugZero Checklist:


Regression Test Proposal

  1. Open the App
  2. Go offline
  3. Click on your avatar > Workspaces
  4. Select a workspace to upload an avatar
  5. Click on the avatar and upload a picture
  6. Click on Save
  7. Verify that no error should appear after uploading the WS avatar
  • Do we agree 👍 or 👎

@jliexpensify
Copy link
Contributor

Payment Summary:

Upwork job

@jliexpensify
Copy link
Contributor

Paid and 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

7 participants