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-08-02] [$1000] Web - App displays upload popup along with edit photo page on double enter on photo upload in profile #21108

Closed
1 of 6 tasks
kbecciv opened this issue Jun 20, 2023 · 87 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 Engineering External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff

Comments

@kbecciv
Copy link

kbecciv commented Jun 20, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open settings
  3. Open profile
  4. Hover on avatar and click on Upload photo
  5. Click once on any photo and press enter twice

Expected Result:

App should display Edit photo page

Actual Result:

App displays upload popup over edit photo page on double enter on image selection

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.34-1

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

Notes/Photos/Videos: Any additional supporting documentation

upload.photo.popup.over.edit.on.double.enter.1.mp4
Recording.5048.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686674302705589

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015dc01579b72a60e7
  • Upwork Job ID: 1674404630480990208
  • Last Price Increase: 2023-06-29
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 20, 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

@Ollyws
Copy link
Contributor

Ollyws commented Jun 20, 2023

Proposal

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

If open, the upload popup remains open on edit photo page

What is the root cause of that problem?

We aren't closing the popup when navigating to avatarCropModal

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

We can set the isMenuVisible state variable to false when calling showAvatarCropModal.

What alternative solutions did you explore? (Optional)

None

@alitoshmatov
Copy link
Contributor

alitoshmatov commented Jun 20, 2023

Proposal

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

Web - App displays upload popup along with edit photo page on double enter on photo upload in profile

What is the root cause of that problem?

When we press enter first time, file window is getting closed, and avatar is being focused. In the second time we press enter the crop modal has not been opened yet, and avatar is getting pressed showing popover menu.

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

We should add ref to avatar pressable here which is getting focused in between of enters

<PressableWithoutFeedback
onPress={() => this.setState({isMenuVisible: true})}
accessibilityRole="button"
accessibilityLabel={this.props.translate('avatarWithImagePicker.editImage')}
>

Then we should onBlur this button when image is selected, so that it won't be pressed when second enter occurs. Here:

showAvatarCropModal(image) {

What alternative solutions did you explore? (Optional)

Or we can introduce new variable like isCropModalOpen which keeps track of crop modal status. And we can prevent unwanted press event by checking its value here
https://github.com/Expensify/App/blob/e6c2704eb43d4d31a55eff5d5d1b3e89c5292bc3/src/components/AvatarWithImagePicker.js#LL279C1-L279C1

We cannot use available state(state. isAvatarCropModalOpen) since it is not being updated imidiately.

@c3024
Copy link
Contributor

c3024 commented Jun 20, 2023

Proposal

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

When selecting image by clicking enter quickly two times, upload popup appears over the image crop modal

What is the root cause of that problem?

When enter is pressed, the crop modal does not appear immediately. This slight delay causes the second enter press to click again on the photo and the popup appears.

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

I think the simplest way is to set isMenuVisible to false after the ImageCropView appears.
We pass setIsMenuVisible to AvatarCropModal which in turn passes to ImageCropView in which we can useEffect to change isMenuVisbile to false.
Existing code is as follows:
https://github.com/Expensify/App/blob/5b7f39b8f8db46acb916304f0ec2aa1bdf8c5e2f/src/components/AvatarWithImagePicker.js#LL343C17-L351C19
https://github.com/Expensify/App/blob/93042af926baa0e36c6f5f518ed16b41e25c2e27/src/components/AvatarCropModal/AvatarCropModal.js#LL382C25-L393C27
We will modify the snippet in AvatarWithImagePicker to

                <AvatarCropModal
                    onClose={this.hideAvatarCropModal}
                    isVisible={this.state.isAvatarCropModalOpen}
                    onSave={this.props.onImageSelected}
                    imageUri={this.state.imageUri}
                    imageName={this.state.imageName}
                    imageType={this.state.imageType}
                    maskImage={this.props.editorMaskImage}
                  +setIsMenuVisible={(isMenuVisible) => this.setState({isMenuVisible})}
                />

AvatarCropModal.js to

                        <ImageCropView
                            imageUri={props.imageUri}
                            containerSize={imageContainerSize}
                            panGestureEventHandler={panGestureEventHandler}
                            originalImageHeight={originalImageHeight}
                            originalImageWidth={originalImageWidth}
                            scale={scale}
                            translateY={translateY}
                            translateX={translateX}
                            rotation={rotation}
                            maskImage={props.maskImage}
                          +setIsMenuVisible={props.setIsMenuVisible}
                        />

add useEffect to ImageCropView

React.useEffect(() => {
        props.setIsMenuVisible(false);
    }, []);

What alternative solutions did you explore? (Optional)

Passing inline function in AvatarCropModal can be changed into a separate function as this inline function would be made everytime but I think this is a non-issue as it is just image change.

Screen.Recording.2023-06-20.at.9.04.43.PM.mov

@melvin-bot melvin-bot bot added the Overdue label Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

@muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@muttmuure
Copy link
Contributor

Unable to reproduce this. If you're still seeing it please comment in the issue

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@muttmuure muttmuure added the Needs Reproduction Reproducible steps needed label Jun 26, 2023
@c3024
Copy link
Contributor

c3024 commented Jun 26, 2023

The bug still exists. Here is the video. One should click enter twice quickly in the image picker window to see the bug.

Screen.Recording.2023-06-26.at.6.43.51.PM.mov
Screen.Recording.2023-06-26.at.6.46.59.PM.mov

@dhanashree-sawant
Copy link

Agree, I tested it on staging and still could see the bug.

@c3024
Copy link
Contributor

c3024 commented Jun 26, 2023

Reproducible in production as well.

@dhanashree-sawant
Copy link

This is on current staging build

Screen.Recording.2023-06-26.at.6.49.54.PM.mov

@muttmuure muttmuure reopened this Jun 29, 2023
@muttmuure
Copy link
Contributor

I have reopened the issue but it will be a few days before I can test again unfortunately

@conorpendergrast
Copy link
Contributor

I've reproduced on v1.3.34-1, Mac OSX Chrome

image

@conorpendergrast conorpendergrast added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Jun 29, 2023
@melvin-bot melvin-bot bot changed the title Web - App displays upload popup along with edit photo page on double enter on photo upload in profile [$1000] Web - App displays upload popup along with edit photo page on double enter on photo upload in profile Jun 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015dc01579b72a60e7

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

melvin-bot bot commented Jun 29, 2023

Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new.

@robertjchen
Copy link
Contributor

Yep, that's probably the best option at this point- let's go with @Ollyws 's proposal!

@robertjchen robertjchen assigned Ollyws and unassigned Ollyws Jul 20, 2023
@robertjchen robertjchen added the External Added to denote the issue can be worked on by a contributor label Jul 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

Current assignee @fedirjh is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

📣 @Ollyws 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

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 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Upwork job

@Ollyws
Copy link
Contributor

Ollyws commented Jul 20, 2023

PR is open.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 26, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - App displays upload popup along with edit photo page on double enter on photo upload in profile [HOLD for payment 2023-08-02] [$1000] Web - App displays upload popup along with edit photo page on double enter on photo upload in profile Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 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.
  • [@conorpendergrast] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: No, do not create

@fedirjh
Copy link
Contributor

fedirjh commented Aug 1, 2023

BugZero Checklist:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 1, 2023
@conorpendergrast
Copy link
Contributor

This looks like it should have the urgency bonus included:

So I'm going to add the 50% urgency bonus too

@conorpendergrast
Copy link
Contributor

conorpendergrast commented Aug 2, 2023

Payouts due:

Eligible for 50% #urgency bonus? Yes

Upwork job is here

@conorpendergrast
Copy link
Contributor

All paid, and all done. Thank you everyone!

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 Engineering External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests