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

[payment due 9/6][$250] Avatar - Unable to choose profile avatar from library #48242

Closed
2 of 6 tasks
izarutskaya opened this issue Aug 29, 2024 · 17 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 29, 2024

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
Pending when validation PR #47338
Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Launch New Expensify app.
  2. Go to Account settings > Profile.
  3. Tap on the avatar.
  4. Tap Choose from library.
  5. Select a photo.
  6. Tap on the app back button.
  7. Tap on the avatar.
  8. Tap Choose from library.

Expected Result:

User should be able to choose profile avatar from library.

Actual Result:

Nothing happens after tapping Choose from library.

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

Bug6585847_1724882763812.ScreenRecording_08-29-2024_06-02-18_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ca983c30cf1e2b4a
  • Upwork Job ID: 1829208880175339857
  • Last Price Increase: 2024-08-29
  • Automatic offers:
    • eh2077 | Reviewer | 103738968
Issue OwnerCurrent Issue Owner: @eh2077
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

Triggered auto assignment to @Christinadobrzyn (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.

@bernhardoj
Copy link
Contributor

Proposal

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

The option to select image doesn't show after selecting Upload photo

What is the root cause of that problem?

The profile page is wrapped with MenuItemGroup.

<MenuItemGroup>
<View style={[styles.flex1, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
title={translate('profilePage.publicSection.title')}
subtitle={translate('profilePage.publicSection.subtitle')}
isCentralPane
subtitleMuted
childrenStyles={styles.pt5}
titleStyles={styles.accountSettingsSectionTitle}
>
<View style={[styles.pt3, styles.pb6, styles.alignSelfStart]}>
<AvatarWithImagePicker

MenuItemGroup pass down a context of single execution and wait for navigate function.

function MenuItemGroup({children, shouldUseSingleExecution = true}: MenuItemGroupProps) {
const {isExecuting, singleExecution} = useSingleExecution();
const waitForNavigate = useWaitForNavigation();
const value = useMemo(
() => (shouldUseSingleExecution ? {isExecuting, singleExecution, waitForNavigate} : undefined),
[shouldUseSingleExecution, isExecuting, singleExecution, waitForNavigate],
);
return <MenuItemGroupContext.Provider value={value}>{children}</MenuItemGroupContext.Provider>;

When we press Upload photo, it will call single execution and wait for navigate. Single execution will set the isExecuting state to true

if (onPress && event) {
if (!singleExecution || !waitForNavigate) {
onPress(event);
return;
}
singleExecution(
waitForNavigate(() => {
onPress(event);
}),
)();

which will disable the menu item.

disabled={disabled || isExecuting}

It will be enabled back once the promise of the action passed to singleExecution is resolved.

InteractionManager.runAfterInteractions(() => {
if (!(execution instanceof Promise)) {
setIsExecuting(false);
return;
}
execution.finally(() => {
setIsExecuting(false);
});

In our case, the promise is the waitForNavigate,

return (navigate: () => void) => () => {
navigate();
return new Promise<void>((resolve) => {
resolvePromises.current.push(resolve);
});

and it will be resolved once the blur event is triggered. But since there is no navigation happening, the promise is never resolved.

This issue happens after the copilot PR where we move the profile image to profile page.

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

We can disable the single execution + wait for navigate thing for the profile image picker by wrapping it with another MenuItemGroup and pass shouldUseSingleExecution as false. This way, the menu item inside the popover menu won't use the single execution logic and will behave like before the copilot PR.

<MenuItemGroup shouldUseSingleExecution={false}>
    <AvatarWithImagePicker ...

<View style={[styles.pt3, styles.pb6, styles.alignSelfStart]}>
<AvatarWithImagePicker

Or we can do it the hard way by accepting a new props to disable either single execution or wait for navigate or both.

What alternative solutions did you explore? (Optional)

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

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

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.

@yuwenmemon yuwenmemon added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2024
@melvin-bot melvin-bot bot changed the title Avatar - Unable to choose profile avatar from library [$250] Avatar - Unable to choose profile avatar from library Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01ca983c30cf1e2b4a

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

melvin-bot bot commented Aug 29, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Aug 29, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @eh2077

@allroundexperts
Copy link
Contributor

Since I reviewed the PR, can I be assigned here?

@puneetlath puneetlath assigned allroundexperts and unassigned eh2077 Aug 29, 2024
@puneetlath puneetlath removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Aug 30, 2024
@Christinadobrzyn Christinadobrzyn changed the title [$250] Avatar - Unable to choose profile avatar from library [payment due 9/6][$250] Avatar - Unable to choose profile avatar from library Sep 3, 2024
@Christinadobrzyn Christinadobrzyn removed the Bug Something is broken. Auto assigns a BugZero manager. label Sep 3, 2024
@Christinadobrzyn Christinadobrzyn removed their assignment Sep 3, 2024
@Christinadobrzyn Christinadobrzyn added the Bug Something is broken. Auto assigns a BugZero manager. label Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

Triggered auto assignment to @zanyrenney (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.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 3, 2024
@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Sep 3, 2024

Looks like PR was deployed to production on 8/30. Payment day is 9/6. I'm going to be ooo so going to add a BZ teammate to issue payment.

Payouts due:

cc @zanyrenney

@Christinadobrzyn Christinadobrzyn self-assigned this Sep 3, 2024
@bernhardoj
Copy link
Contributor

Yes, I'll request in ND.

@zanyrenney
Copy link
Contributor

I don't think we need a regression test for this.

@zanyrenney
Copy link
Contributor

Payment summary above closing as both are paid via ND.

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@JmillsExpensify
Copy link

$250 approved for @allroundexperts

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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

10 participants