Skip to content

[HOLD for c+ payment in newdot] [$1000] Dev: "0:undefined:" displayed in reaction emoji tooltip #23307

Closed

Description

@kbecciv

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 a chat
  2. Send a message
  3. React message with any emoji
  4. Right click on reacted emoji
  5. Notice "0:undefined:" will be displayed

Expected Result:

"0:undefined:" displayed should not displayed in reaction emoji tooltip

Actual Result:

"0:undefined:" displayed in reaction emoji tooltip

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: Dev v1.3.43-2
Reproducible in staging?: n/a
Reproducible in production?: n/a
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-07-20-at-45905-pm_i7reUDxU.mp4

Screenshot 2023-07-20 at 5 02 49 PM

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ca4a5f95b82060ec
  • Upwork Job ID: 1682153064419074048
  • 2023-07-20
  • Automatic offers:
    • | | 0
    • jfquevedol2198 | Contributor | 25679499
    • | | 0

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 20, 2023
  2. melvin-bot commented on Jul 20, 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 Jul 20, 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. StevenKKC commented on Jul 20, 2023

    @StevenKKC
    Contributor

    Proposal

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

    "0:undefined:" displayed in reaction emoji tooltip.

    What is the root cause of that problem?

    Reaction emoji tooltip is displayed by following code.

    const onReactionListOpen = (event) => {
    reactionListRef.current.showReactionList(event, popoverReactionListAnchor.current, reaction.emoji, props.reportActionID);
    };

    We pass reaction.emoji to showReactionList in this line.
    But showReactionList requires emojiName, so "0:undefined:" displayed in reaction emoji tooltip.

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

    We should pass reaction.emojiName to showReactionList.

        reactionListRef.current.showReactionList(event, popoverReactionListAnchor.current, reaction.emojiName, props.reportActionID);

    And in this line, there is no hasAccountIDReacted function in Report.js.
    We should change to hasAccountIDEmojiReacted function.

        const hasUserReacted = Report.hasAccountIDEmojiReacted(this.props.currentUserPersonalDetails.accountID, reactionUsers);

    What alternative solutions did you explore? (Optional)

    None.

  5. ayazhussain79 commented on Jul 20, 2023

    @ayazhussain79
    Contributor

    This bug might be regression of this PR

  6. jfquevedol2198 commented on Jul 20, 2023

    @jfquevedol2198
    Contributor

    Proposal

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

    Dev: "0:undefined:" displayed in reaction emoji tooltip

    What is the root cause of that problem?

    1. In this line, reaction.emoji is undefined.

    const onReactionListOpen = (event) => {
    reactionListRef.current.showReactionList(event, popoverReactionListAnchor.current, reaction.emoji, props.reportActionID);
    };

    1. In this line, Report.hasAccountIDReacted is not found.

    const hasUserReacted = Report.hasAccountIDReacted(this.props.currentUserPersonalDetails.accountID, reactionUsers);

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

    1. Update this line to
        reactionListRef.current.showReactionList(event, popoverReactionListAnchor.current, reaction.emojiName, props.reportActionID);
    1. Update this line
        const hasUserReacted = Report.hasAccountIDEmojiReacted(this.props.currentUserPersonalDetails.accountID, reactionUsers);

    By doing this: popup should look like follows, Its missing Emoji on Popup.
    image

    1. We need to do this:

    App/src/libs/EmojiUtils.js

    Lines 395 to 406 in 7fea760

    const getUniqueEmojiCodes = (emojiAsset, users) => {
    const uniqueEmojiCodes = [];
    _.each(users, (userSkinTones) => {
    _.each(lodashGet(userSkinTones, 'skinTones'), (createdAt, skinTone) => {
    const emojiCode = getPreferredEmojiCode(emojiAsset, skinTone);
    if (emojiCode && !uniqueEmojiCodes.includes(emojiCode)) {
    uniqueEmojiCodes.push(emojiCode);
    }
    });
    });
    return uniqueEmojiCodes;
    };

    In EmojiUtils.getUniqueEmojiCodes,
    users should be

        {[accountID]: {skinTones: {createdAt, skinTone}}
        or
         [ {accountID, skinTones: {createdAt, skinTone}} ]

    But on PopoverReactionsList, its passing like this:

        [ {accountID, skinTone} ]

    Update this line so that we will get users in [ {accountID, skinTones: {createdAt, skinTone}} ] type.

        getSelectedReactionFromAction(reportAction, emojiName) {
            const reactions = lodashGet(reportAction, ['message', 0, 'reactions'], []);
            const reactionsWithCount = _.filter(reactions, (reaction) => reaction.users.length > 0);
            const reaction = _.find(reactionsWithCount, (reaction) => reaction.emoji === emojiName);
            if (reaction) {
                return {
                    ...reaction,
                    users: reaction.users.map(({accountID, skinTone}) => ({accountID, skinTones: {skinTone}}))
                }
            }
            return undefined;
        }
    RESULT image

    What alternative solutions did you explore? (Optional)

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 20, 2023
  8. stitesExpensify commented on Jul 20, 2023

    @stitesExpensify
    Contributor

    I agree that this is most likely a regression from that PR.

  9. changed the title [-]Dev: "0:undefined:" displayed in reaction emoji tooltip[/-] [+][$1000] Dev: "0:undefined:" displayed in reaction emoji tooltip[/+] on Jul 20, 2023
  10. 24 remaining items

  11. melvin-bot commented on Jul 27, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.46-2 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-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.

    • 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
  12. melvin-bot commented on Jul 27, 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:

    • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR:
    • [@Santhosh-Sellavel] 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:
    • [@Santhosh-Sellavel] 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:
    • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
    • [@Santhosh-Sellavel] 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:
  13. Santhosh-Sellavel commented on Aug 3, 2023

    @Santhosh-Sellavel
    Collaborator

    @jfquevedol2198 This is due for payment today, and payment will be handled by @kadiealexander!

  14. Santhosh-Sellavel commented on Aug 3, 2023

    @Santhosh-Sellavel
    Collaborator

    @kadiealexander I think this qualifies for a speed bonus, please check as it completed 72 business hours, not sure why Melvin didn't trigger that comment.

  15. Santhosh-Sellavel commented on Aug 3, 2023

    @Santhosh-Sellavel
    Collaborator

    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:

    • [@Santhosh-Sellavel] The PR that introduced the bug has been identified. Link to the PR: As per this comment, we are just improving the changes missed out here
    • [@stitesExpensify] 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:
    • [@Santhosh-Sellavel] 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: N/A should be caught while testing
    • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug. N/A As its really basic UI
    • [@Santhosh-Sellavel] 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 the above steps have been agreed upon:

    @stitesExpensify Do you agree with the above, if so please check off 2nd alone. Thanks, If you differ on any of the above please let me know thanks!

  16. Santhosh-Sellavel commented on Aug 3, 2023

    @Santhosh-Sellavel
    Collaborator

    @kadiealexander I think this qualifies for a speed bonus, please check as it completed 72 business hours, not sure why Melvin didn't trigger that comment.

    @kadiealexander Can you check this summarize so I can collect payment on ND, thanks!

  17. kadiealexander commented on Aug 3, 2023

    @kadiealexander
    Contributor

    Payouts due:

    Eligible for 50% #urgency bonus? Yes

    Upwork job is here.

  18. Santhosh-Sellavel commented on Aug 4, 2023

    @Santhosh-Sellavel
    Collaborator

    Thanks, Requested Payment on ND!

  19. changed the title [-][HOLD for payment 2023-08-03] [$1000] Dev: "0:undefined:" displayed in reaction emoji tooltip[/-] [+][HOLD for c+ payment in newdot] [$1000] Dev: "0:undefined:" displayed in reaction emoji tooltip[/+] on Aug 4, 2023
  20. JmillsExpensify commented on Aug 4, 2023

    @JmillsExpensify
    Contributor

    Reviewed details for @Santhosh-Sellavel. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorNeeds ReproductionReproducible steps neededWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions