Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.54k stars 2.89k forks source link

[HOLD for payment 2023-03-23] [$2000] Resizing window when editing an avatar triggers a server error #14712

Closed kavimuru closed 1 year ago

kavimuru commented 1 year ago

If you havenโ€™t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open Settings
  2. Click Profile
  3. Click the avatar image
  4. Choose upload photo and pick any photo
  5. Scroll the slider to the max
  6. Reposition the image view to a corner/border.
  7. Make the window much smaller (still usable though)
  8. Click save

Expected Result:

Image is trimmed properly and saved properly

Actual Result:

Image goes out of bounds, sends the out of bounds picture to the server and we get a 502 server error (with potentially sensitive info)

Workaround:

unknown

Platforms:

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

Version Number: 1.2.63-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 Notes/Photos/Videos:

https://user-images.githubusercontent.com/43996225/215887038-cf9f69e2-ae29-4312-9458-77031ba9cd29.mov

https://user-images.githubusercontent.com/43996225/215887257-f4fccb69-2353-4df0-a5a6-8892c1e84b9f.mp4

Expensify/Expensify Issue URL: Issue reported by: @oesayan Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674723830727639

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018e2392a94caf511b
  • Upwork Job ID: 1620844392158330880
  • Last Price Increase: 2023-02-28
parasharrajat commented 1 year ago

Doing the final checks now. Next update in 2 hours.

parasharrajat commented 1 year ago

Sorry, it's taking a bit long. I am trying to understand the code of AvatarCropModal. But I am will finalize it asap before EOD.

There are similar proposals.

Prince-Mendiratta commented 1 year ago

@parasharrajat If it helps, I can create a branch with the changes I proposed and you can directly check out the fix and understand what I proposed by seeing the code itself, what do you think?

parasharrajat commented 1 year ago

Thanks for the suggestion. I will ask for the needed info if necessary.

abekkala commented 1 year ago

@parasharrajat how are you doing here? is there anything that @MariaHCD can help you with?

parasharrajat commented 1 year ago

@Prince-Mendiratta I do not understand your first proposal https://github.com/Expensify/App/issues/14712#issuecomment-1412725333. You presented two solutions but neither of them explains how will you do it.

Solution 1 talks about the challenge of getting context values that you left unattended. It seems incomplete.
Solution 2 is completely a different thing. It seems like an additional/optional step to the original solution. I will not name them as Solution 1 and 2. It is confusing and distracting.

Thus, I am gonna reject that.

Still looking for other ones....

Prince-Mendiratta commented 1 year ago

@parasharrajat please ignore my original proposal, that's an incomplete one I made based on partial facts.

The things I'd like for you to have a look at are the latest proposal and the bug I found and reported here.

parasharrajat commented 1 year ago

Can you hide the old post(not delete) to make it clear? Also, follow this pattern for the future.

parasharrajat commented 1 year ago

@alexxxwork Thanks for the asking and @Prince-Mendiratta for explaining it. I got the idea of what you are proposing from https://github.com/Expensify/App/issues/14712#issuecomment-1432186637. I also noticed this behavior during resizing and kind of trying to explain the same in https://github.com/Expensify/App/issues/14712#issuecomment-1423774240 without testing. But I didn't know that it already existed so I thought that proposal is breaking that.


I would have chosen @alexxxwork 's proposal if we are trying to solve only the issue. But I @Prince-Mendiratta 's proposal enhances the image crop modal as well as fixes the issue.

Thus, I think we can go with @Prince-Mendiratta 's proposal for this one. Here is the better explanation of it.

Questions:

  1. is there any performance impact of your solution?
  2. It should not slow down the zooming and panning of the image crop modal. We spent a considerably long time optimizing it in initial implementation for all platforms. That's why react-native-reanimated was used here.

    cc: @MariaHCD

:ribbon: :eyes: :ribbon: C+ reviewed

parasharrajat commented 1 year ago

Lastly, apologies to all contributors and assigned Engineers for so much delay. I wasn't fully committed the last month and it impacted all of you.

cc: @MariaHCD @abekkala

parasharrajat commented 1 year ago

@abekkala Can you please revert the labels to external? This is not coming into my external issues filter.

Prince-Mendiratta commented 1 year ago

Thanks for the review, @parasharrajat!

is there any performance impact of your solution?

Nothing significant. The changes I'm proposing apply to these cases:

  1. When the image is panned / zoomed. In this case, the maxOffsetX and maxOffsetY are stored in the prevMaxOffsetX and prevMaxOffsetY shared value. This does not involve any recalculations and happens after the translation values are updated so no major impact here.

  2. When the browser is resized. Here, if no panning has happened, we do an early return in useEffect and thus, no calculations involved. If there are some initial values to prevMaxOffset, in this case the interpolated values are calculated but this doesn't affect existing functionality as it is only the slight time that is taken to show the updated offset values.

So no, no unnecessary calculations or major performance impacts introduced by these changes.


Also, I came back to explore this issue and post a proposal after the price increase had happened here, was't aware that the proposals were still under review. Since the proposal accepted was after the price increase, I'd like to request you to kindly reconsider the decision to revert the pricing. Either way, appreciate it.

cc @abekkala @MariaHCD

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

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

parasharrajat commented 1 year ago

Bump @MariaHCD, if you missed the comment above https://github.com/Expensify/App/issues/14712#issuecomment-1462788803.

MariaHCD commented 1 year ago

Apologies for the delay here! I think @Prince-Mendiratta's proposal looks great as well!

MelvinBot commented 1 year ago

๐Ÿ“ฃ @Prince-Mendiratta You have been assigned to this job by @MariaHCD! Please apply to this job in Upwork 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 ๐Ÿ“–

Prince-Mendiratta commented 1 year ago

Thanks, @MariaHCD @parasharrajat!

PR is ready for review.

Applied in Upwork.


Also, I came back to explore this issue and post a proposal after the price increase had happened https://github.com/Expensify/App/issues/14712#issuecomment-1431584217, was't aware that the proposals were still under review. Since the proposal accepted was after the price increase, I'd like to request you to kindly reconsider the decision to revert the pricing. Either way, appreciate it.

Any comments on this?

cc @abekkala

MariaHCD commented 1 year ago

Also, I came back to explore this issue and post a proposal after the price increase had happened here, was't aware that the proposals were still under review. Since the proposal accepted was after the price increase, I'd like to request you to kindly reconsider the decision to revert the pricing. Either way, appreciate it.

Hey, @Prince-Mendiratta! That's a good point but in my opinion, this issue should never have been bumped to $4000 and @parasharrajat did comment here that the price should be reverted back to $2000 before your proposal. However, I'll lean on @abekkala or @parasharrajat to weigh in.

alexxxwork commented 1 year ago

@parasharrajat @MariaHCD I would like to mention the timing on this issue Feb 01 - issue created and the price was $1000 Feb 02 - I made a proposal Feb 06 - Price was automatically increased to $2000 Feb 09 - Updated my proposal with current template Feb 15 - Price was automatically increased to $4000 Feb 16 - @Prince-Mendiratta made a proposal with some UX enhancements.

It would be helpful to read any guides on how and when proposals are estimated and on which cases the automatic price increase is reverted back.

MariaHCD commented 1 year ago

@alexxxwork Good questions, at the moment, we don't have specific guidelines on when automatic price increases are reverted (it varies depending on the situation). But in this case, the price increase was reverted because it was not that there were a lack of proposals, it was that the proposals needed to be fully reviewed.

In terms of the timeline for proposals, proposals should be evaluated within 2 days.

I hope that clarifies things!

Prince-Mendiratta commented 1 year ago

Thanks for the timeline, @alexxxwork :)

did comment here that the price should be reverted back to $2000 before your proposal

@MariaHCD Yeah, but I was already invested and testing the changes on different platforms with the proposal by that time, didn't make sense to not post the proposal haha. It's just that since the ideal proposal accepted was after the price change and I saw the ping on slack that this issue came back on my radar, that's why I was asking to reconsider that decision.

Either way, I'll trust the better judgement of the team!

parasharrajat commented 1 year ago

For clarity, we were already going to reduce the price to 2K before you posted a new proposal. Thus I agree with the pricing here. Anyways, there is a bonus :smile: .

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.2.85-1 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-03-23. :confetti_ball:

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.

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

MelvinBot commented 1 year ago

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:

MelvinBot commented 1 year ago

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

abekkala commented 1 year ago

Payments to be made Mar 23 Issue reported by: @oesayan [$250] Fix: @Prince-Mendiratta [$2000] Assigned March 13 - Merged PR March 16 50% Bonus [$1,000] Reviewed PR: @parasharrajat [$2000] PR Bonus [$1,000]

parasharrajat commented 1 year ago

@abekkala can you please send a job invite to my profile?

abekkala commented 1 year ago

@parasharrajat I'll be doing that today March 23 as today is the payment date

abekkala commented 1 year ago

@parasharrajat can you please propose the regression test steps

abekkala commented 1 year ago

Job Invite/offers sent to: Issue reported by: @oesayan [$250] Fix: @Prince-Mendiratta [$2000] 50% Bonus will be added at payment [$1,000] Reviewed PR: @parasharrajat [$2000] 50% Bonus will be added at payment [$1,000]

abekkala commented 1 year ago

@oesayan Paid and contract ended - thank you! ๐ŸŽ‰

Prince-Mendiratta commented 1 year ago

@abekkala Thank you! Can you please check the offer, I'm unable to accept the contract. image

abekkala commented 1 year ago

@Prince-Mendiratta oh odd! let me take a look!

abekkala commented 1 year ago

Hmm, not sure what happened there I'll resend to you and @parasharrajat

abekkala commented 1 year ago

@Prince-Mendiratta Paid and contract ended - thank you! ๐ŸŽ‰

parasharrajat commented 1 year ago

@abekkala Thanks for the offer. But Can you please invite me to the job first instead of directly sending the offer my profile ?

abekkala commented 1 year ago

I had to create a 'payment job' as the other one is closed. The first invite got messed up within Upwork. I can just invite you to the payment job if you feel that's necessary instead of just accepting the contract

parasharrajat commented 1 year ago

yeah, let's do that.

abekkala commented 1 year ago
Screenshot 2023-03-23 at 11 58 19 AM

Let me know when you approve so I can make payment.

And please complete this: https://github.com/Expensify/App/issues/14712#issuecomment-1481405716

parasharrajat commented 1 year ago

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:

[@parasharrajat / @MariaHCD] The PR that introduced the bug has been identified. Link to the PR: It is an enhancement to the original implementation.

[@parasharrajat / @MariaHCD] 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: N/A

[@parasharrajat / @MariaHCD] 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: I think it is an edge case and the only method to catch these that I see is testing rigorously.

[@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to the appropriate location to ensure the same bug will not reach production again. https://github.com/Expensify/App/issues/14712#issuecomment-1481752040

abekkala commented 1 year ago

@parasharrajat I'm going ooo until April 04 - if you'd like me to process that payment today please accept the offer (I've now sent 2)

Also - the checklist is already posted above: https://github.com/Expensify/App/issues/14712#issuecomment-1471714056

Please provide the regressions steps. https://github.com/Expensify/App/issues/14712#issuecomment-1481405716

parasharrajat commented 1 year ago

@abekkala I haven't setup the TestRail account yet and I am not sure how to use it. I am waiting on a demo video from the internal team. So is it fine if I post the steps here?

abekkala commented 1 year ago

Yes - no need to note placement just the steps

parasharrajat commented 1 year ago

Regression Test Proposal

  1. Open the App on the Web and login with your account.

  2. Navigate to Settings > Profile Page.

  3. Click on your Avatar, it should take you to the Edit Profile page.

  4. Click again on the Avatar, and select Upload Photo.

  5. Select any photo from file Manager popup.

  6. On the Photo Editor Page, Zoom-in at max scale.

  7. Pan the image to the Right-corner as much as possible.

  8. Now resize the browser to mobile View.

  9. Try to reduce the height of the browser window until the Editor canvas is very small 1cmx1cm.

  10. Press Save.

  11. Observe that there are no errors.

Do we agree :+1: +1 or :-1:?

Prince-Mendiratta commented 1 year ago
  1. On the Photo Editor Page, Zoom-in at max scale.
  2. Now resize the browser to mobile View.

It'll be better to add a new step in between these to pan the image to a corner of the image before resizing.

parasharrajat commented 1 year ago

@abekkala Offer accepted. @Prince-Mendiratta Added the step. Thanks.

abekkala commented 1 year ago

@parasharrajat Paid and contract ended - thank you! ๐ŸŽ‰