You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-06-07] [$1000] Center QR image turns into difference avatar for a moment after being removed. #19211
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
From the first tab open Share QR image, from second tab, try to remove the user avatar.
Observe the center Qr image.
Expected Result:
Center QR image should turn into default avatar.
Actual Result:
Center QR image turns into difference avatar for a moment after being removed.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
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: 1.3.16.3 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
In ShareCodePage, we're using this.props.currentUserPersonalDetails.avatar to generate QR code, which uses above value directly => it explains why we see the oldDot avatar in QR code for a moment then see newDot avatar.
What changes do you think we should make in order to solve the problem?
We can't reuse the util ReportUtils.getAvatar like other places. Because it will return a SVG component if the current avatar is the default one. QRCode library expect a string of URL not a React component.
So we can make another ReportUtils.getAvatarUrl same as ReportUtils.getAvatar but it returns a newDot default URL instead of SVG component when it's a default avatar.
The function to get newDot default URL is almost same with oldDot. But instead of avatar_${loginHashBucket}.png, it should be default-avatar_${loginHashBucket}.png
What alternative solutions did you explore? (Optional)
Instead of use oldDot default avatar, we can use newDot default avatar for optimisticData, because later on, the API still return the newDot default avatar. So it doesn't make sense to use oldDot default avatar anymore => Write a new util ReportUtils.getNewDotDefaultAvatar same as oldDot, but return with prefix default- (I.e default-avatar_4.png)
changed the title [-]Center QR image turns into difference avatar for a moment after being removed.[/-][+][$1000] Center QR image turns into difference avatar for a moment after being removed.[/+]on May 19, 2023
changed the title [-][$1000] Center QR image turns into difference avatar for a moment after being removed.[/-][+][HOLD for payment 2023-06-07] [$1000] Center QR image turns into difference avatar for a moment after being removed.[/+]on May 31, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.20-5 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-06-07. 🎊
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
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
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.
[@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Link to discussion: N/A , This looks an edge case , testing different scenario would help catch this bug earlier (well for this case it doesn’t look like a realistic test case). I don't think we have anything to add to the current checklist. Let me know if we should create a discussion thread for that.
Regression Test: N/A This is an edge case where user has to open the same page on two different devices simultaneously and then tries to remove avatar. Doesn’t looks like a realistic test case.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Activity
melvin-bot commentedon May 18, 2023
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon May 18, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)hoangzinh commentedon May 18, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Center QR image turns into difference avatar for a moment after being removed
What is the root cause of that problem?
When we delete user avatar, we set optimisticData of user's avatar to oldDot default avatar (e.i: https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_4.png).
App/src/libs/actions/PersonalDetails.js
Line 376 in 2090c05
Later on, the API returns default avatar with newDot (e.i: https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_4.png)

In ShareCodePage, we're using this.props.currentUserPersonalDetails.avatar to generate QR code, which uses above value directly => it explains why we see the oldDot avatar in QR code for a moment then see newDot avatar.
What changes do you think we should make in order to solve the problem?
We can't reuse the util
ReportUtils.getAvatarlike other places. Because it will return a SVG component if the current avatar is the default one. QRCode library expect a string of URL not a React component.So we can make another
ReportUtils.getAvatarUrlsame asReportUtils.getAvatarbut it returns a newDot default URL instead of SVG component when it's a default avatar.The function to get newDot default URL is almost same with oldDot. But instead of
avatar_${loginHashBucket}.png, it should bedefault-avatar_${loginHashBucket}.pngWhat alternative solutions did you explore? (Optional)
Instead of use oldDot default avatar, we can use newDot default avatar for optimisticData, because later on, the API still return the newDot default avatar. So it doesn't make sense to use oldDot default avatar anymore => Write a new util ReportUtils.getNewDotDefaultAvatar same as oldDot, but return with prefix
default-(I.e default-avatar_4.png)App/src/libs/actions/PersonalDetails.js
Line 376 in 2090c05
kadiealexander commentedon May 19, 2023
Reproduced in Chrome:
2023-05-19_14-03-36.mp4
[-]Center QR image turns into difference avatar for a moment after being removed.[/-][+][$1000] Center QR image turns into difference avatar for a moment after being removed.[/+]melvin-bot commentedon May 19, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e69cb0f1402572c0
melvin-bot commentedon May 19, 2023
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon May 19, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)33 remaining items
[-][$1000] Center QR image turns into difference avatar for a moment after being removed.[/-][+][HOLD for payment 2023-06-07] [$1000] Center QR image turns into difference avatar for a moment after being removed.[/+]melvin-bot commentedon May 31, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 31, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.20-5 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-06-07. 🎊
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:
melvin-bot commentedon May 31, 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:
kadiealexander commentedon Jun 7, 2023
Assigned - May 25th 2:50pm (GMT+12) - Thursday
Merged - May 29th 5:32pm (GMT+12) - Monday
PR was merged within 3 business days, eligible for speed bonus.
kadiealexander commentedon Jun 7, 2023
Contracts sent to all, @fedirjh please don't forget about the checklist!
fedirjh commentedon Jun 7, 2023
kadiealexander commentedon Jun 8, 2023
Thanks @fedirjh! Everyone is paid so I'm closing this out. Great work team!