-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[PAID] [$1000] Setting - Console error appears and avatar is broken when uploading a photo to the profile #16354
Comments
Triggered auto assignment to @strepanier03 ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~014508d42c3166d105 |
Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
Triggered auto assignment to @yuwenmemon ( |
ProposalProblem: Users are unable to successfully upload a profile photo in the React project, resulting in JavaScript console errors and a failure to update the displayed profile photo.Root Cause: The root cause of this issue might be related to CORS configuration, improper handling of Blob URLs, or incorrect state updates in the application.Proposed Solution:
Alternative Solutions Explored: N/ANext Steps: Once the proposal is reviewed and approved by the Expensify team, I will proceed to implement the changes and create a pull request for review. |
📣 @dayyad! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
Contributor details |
|
Contributor details |
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Console error appears and avatar is broken when uploading a photo to the profile What is the root cause of that problem?This is a regression from #15680. When we upload a new avatar and it is being uploaded to the server, the source of the profile avatar is set as a blob source. However, with PR #15680, we attempt to append Line 580 in e7259a2
And we use it here App/src/components/AvatarWithIndicator.js Line 93 in e7259a2
So when we try to append _128 to source we get this issue
What changes do you think we should make in order to solve the problem?We can check if source is blob and skip adding const regex = /^blob:(.*\/)?[a-f\d-]{36}$/i;
if (regex.test(source)) {
return source;
} I think there is also a small issue here , there is signature mismatch here : App/src/components/AvatarWithIndicator.js Line 93 in e7259a2
And I think the changes should occur here App/src/pages/home/sidebar/SidebarLinks.js Lines 179 to 182 in e7259a2
What alternative solutions did you explore? (Optional)I may tag @Beamanator since he introduced the changes . |
ProposalPlease re-state the problem that we are trying to solve in this issue.Setting - Console error appears and avatar is broken when uploading a photo to the profile What is the root cause of that problem?We add the picture size param to the url suffix, let But when image is uploading, What changes do you think we should make in order to solve the problem?In fact, only Line 573 in ebc03db + const imageServerDomainMatch = '^https://\\w+.cloudfront.net'
+ if (!new RegExp(imageServerDomainMatch).test(avatarURL)) {
+ return source;
+ } Other cases to consider
What alternative solutions did you explore? (Optional)Not Yet |
@strepanier03 This is issue ONLY in stsging, did not use Deploy broker due to PR related. |
@dayyad Thanks for the proposal. I think your RCA is invalid. You need to pinpoint the exact root cause and not list random potential causes. |
@fedirjh Thanks for the proposal. Your RCA is correct however the fix is not solid enough as we may encounter the same issue with other links besides those that start with |
@hellohublot Thanks for the proposal. Your RCA is correct and the proposed fix looks good to me; I like the idea of relaying on a white list instead of a black list. 🎀 👀 🎀 C+ reviewed cc @yuwenmemon |
Regression Test Proposal
|
@yuwenmemon @AndrewGable @marcochavezf is this still a deploy blocker? I'm confused by all the labels on this issue. |
@luacmartins no, it was fixed in #16441 |
@yuwenmemon Please re-open. This is on hold for payment (and checklist). |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.89-0 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-04-03. 🎊 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.
Speed bonus analysis: PR submitted on March 23 - PR merged on March 24 - Eligible As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
Removing the blocker label since this issue was fixed here |
The checklist is has been provided here already #16354 (comment) |
@hellohublot and @s77rt - I have hired you both for the Upwork Job. I've copied over rthe checklist responses into the checklist post, created the reg test GH, and I updated payment amounts (here). Will be back to pay this once it's off hold. |
@hellohublot and @s77rt - I have paid out the jobs and ended the contracts. Thank you both for your hard work! |
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:
Image:
Expected Result:
The profile photo should be display and there should be no error in the console
Actual Result:
Console error appears and avatar is broken when uploading a photo to the profile
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.88.0
Reproducible in staging?: Yes
Reproducible in production?: NO
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
Recording.2347.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: