Skip to content

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

Closed

Description

@izarutskaya

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Aug 29, 2024
  2. melvin-bot commented on Aug 29, 2024

    @melvin-bot

    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.

  3. bernhardoj commented on Aug 29, 2024

    @bernhardoj
    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)

  4. melvin-bot commented on Aug 29, 2024

    @melvin-bot

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

  5. github-actions commented on Aug 29, 2024

    @github-actions
    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.
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 29, 2024
  7. changed the title [-]Avatar - Unable to choose profile avatar from library[/-] [+][$250] Avatar - Unable to choose profile avatar from library[/+] on Aug 29, 2024
  8. 18 remaining items

  9. removed their assignment
    on Sep 3, 2024
  10. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 3, 2024
  11. melvin-bot commented on Sep 3, 2024

    @melvin-bot

    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.

  12. Christinadobrzyn commented on Sep 3, 2024

    @Christinadobrzyn
    Contributor

    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

  13. bernhardoj commented on Sep 4, 2024

    @bernhardoj
    Contributor

    Yes, I'll request in ND.

  14. zanyrenney commented on Sep 10, 2024

    @zanyrenney
    Contributor

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

  15. zanyrenney commented on Sep 10, 2024

    @zanyrenney
    Contributor

    Payment summary above closing as both are paid via ND.

  16. bernhardoj commented on Sep 11, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  17. JmillsExpensify commented on Sep 11, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  18. JmillsExpensify commented on Oct 8, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @allroundexperts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions