Skip to content

[HOLD for payment 2023-06-07] [$1000] Center QR image turns into difference avatar for a moment after being removed. #19211

Closed

Description

@kavimuru

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. Login app in 2 tabs.
  2. From the first tab open Share QR image, from second tab, try to remove the user avatar.
  3. 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

Screen.Recording.2023-05-16.at.22.07.57.mov
Recording.646.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e69cb0f1402572c0
  • Upwork Job ID: 1659379434933579776
  • Last Price Increase: 2023-05-19

Activity

  1. added
    Daily
    Bug
    on May 18, 2023
  2. melvin-bot commented on May 18, 2023

    @melvin-bot

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

  3. melvin-bot commented on May 18, 2023

    @melvin-bot

    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
  4. hoangzinh commented on May 18, 2023

    @hoangzinh
    Contributor

    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).

    const defaultAvatar = ReportUtils.getOldDotDefaultAvatar(currentUserEmail);

    Later on, the API returns default avatar with newDot (e.i: https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_4.png)
    Screenshot 2023-05-19 at 06 16 57

    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)

    const defaultAvatar = ReportUtils.getOldDotDefaultAvatar(currentUserEmail);

  5. kadiealexander commented on May 19, 2023

    @kadiealexander
    Contributor

    Reproduced in Chrome:

    2023-05-19_14-03-36.mp4
  6. added
    External
    on May 19, 2023
  7. 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
  8. melvin-bot commented on May 19, 2023

    @melvin-bot
  9. melvin-bot commented on May 19, 2023

    @melvin-bot

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

  10. melvin-bot commented on May 19, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

  11. added
    Help Wanted
    on May 19, 2023
  12. 33 remaining items

  13. added
    Weekly
    Awaiting Payment
    and removed
    Daily
    on May 31, 2023
  14. 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
  15. removed
    Reviewing
    on May 31, 2023
  16. melvin-bot commented on May 31, 2023

    @melvin-bot

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

  17. melvin-bot commented on May 31, 2023

    @melvin-bot

    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
  18. melvin-bot commented on May 31, 2023

    @melvin-bot

    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:
  19. added
    Daily
    and removed
    Weekly
    on Jun 6, 2023
  20. kadiealexander commented on Jun 7, 2023

    @kadiealexander
    Contributor

    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.

  21. kadiealexander commented on Jun 7, 2023

    @kadiealexander
    Contributor

    Contracts sent to all, @fedirjh please don't forget about the checklist!

  22. fedirjh commented on Jun 7, 2023

    @fedirjh
    Contributor
    • Link to the PR: Feat: Share QR Code #18636
    • Link to comment: Feat: Share QR Code #18636 (comment)
    • 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.
  23. kadiealexander commented on Jun 8, 2023

    @kadiealexander
    Contributor

    Thanks @fedirjh! Everyone is paid so I'm closing this out. Great work team!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternalHelp Wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions