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

Avatar - Invalid avatar format error does not disappear after switching account #48252

Open
2 of 6 tasks
IuliiaHerets opened this issue Aug 29, 2024 · 11 comments
Open
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

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: v9.0.26-1
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in as a copilot.
  3. Go to Account settings > Profile.
  4. Upload a large image that will trigger error.
  5. Click on the account switcher.
  6. Select another account.

Expected Result:

The invalid avatar format error will disappear after switching account.

Actual Result:

The invalid avatar format error does not disappear after switching account.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6585962_1724889972466.20240829_080258.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

Triggered auto assignment to @madmax330 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Aug 29, 2024

Triggered auto assignment to @VictoriaExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Aug 29, 2024

Proposal

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

Invalid avatar format error does not disappear after switching account

What is the root cause of that problem?

We are only reseting error message on blur here

useEffect(() => {
if (isFocused) {
return;
}
// Reset the error if the component is no longer focused.
setError(null, {});
}, [isFocused]);

And when the user changes current user (currentUserPersonalDetails) we don't reset error message
const avatarURL = currentUserPersonalDetails?.avatar ?? '';

<AvatarWithImagePicker
isUsingDefaultAvatar={UserUtils.isDefaultAvatar(currentUserPersonalDetails?.avatar ?? '')}
source={avatarURL}

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

We should also reset error message when source (currentUserPersonalDetails?.avatar) for Avatar component changes.

 useEffect(() => {
        setError(null, {});
    }, [source]);

What alternative solutions did you explore? (Optional)

@puneetlath
Copy link
Contributor

demoting since copilot is under beta cc @rushatgabhane

@madmax330
Copy link
Contributor

@puneetlath @rushatgabhane should I make this external? Or is this part of a project?

@melvin-bot melvin-bot bot removed the Overdue label Sep 2, 2024
@puneetlath
Copy link
Contributor

It looks like it's part of the copilot project that is being worked on in #wave-control. I'm not sure who his working on that, but you should be able to ask there.

@rushatgabhane
Copy link
Member

@puneetlath please assign it to me there is s mega PR on the way

@VictoriaExpensify
Copy link
Contributor

Hey @puneetlath - is this a deploy blocker? Just trying to figure out what actions I need to take here.

@melvin-bot melvin-bot bot removed the Overdue label Sep 6, 2024
@puneetlath
Copy link
Contributor

No, I think copilot is still under beta, so not a blocker.

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Sep 8, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Sep 8, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

This issue has not been updated in over 15 days. @madmax330, @rushatgabhane, @VictoriaExpensify 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants