Skip to content

[HOLD for payment 2024-06-03] [$250] mWeb - Chat - In edit comment, changed skin tone is not applied #42058

Closed

Description

@lanitochka17

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


Version Number: 1.4.73
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4554707
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap in a report
  3. Send a message
  4. Tap emoji picker in compose box and change the skin tone
  5. Enter 👍 and note changed skin tone is applied
  6. Clear the text
  7. In step 3, long press the message sent and tap edit comment
  8. Tap enter key and move cursor to second line.
  9. Enter 👍 and note changed skin tone is not applied

Expected Result:

In edit comment, changed skin tone must be applied

Actual Result:

In edit comment, changed skin tone is not applied

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6479206_1715597160442.Skin.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013cd26a26b248adb5
  • Upwork Job ID: 1790054359169802240
  • Last Price Increase: 2024-05-13
  • Automatic offers:
    • s77rt | Reviewer | 0
    • bernhardoj | Contributor | 0
Issue OwnerCurrent Issue Owner: @garrettmknight

Activity

  1. added
    Daily
    Bug
    on May 13, 2024
  2. melvin-bot commented on May 13, 2024

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. lanitochka17 commented on May 13, 2024

    @lanitochka17
    Author

    @garrettmknight FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. lanitochka17 commented on May 13, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp

  5. bernhardoj commented on May 13, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The preferred skin tone doesn't update in edit composer, but updates in main composer.

    What is the root cause of that problem?

    The preferred skin tone value is passed from the ReportActionItem to the composer.

    export default withOnyx<ReportActionItemProps, ReportActionItemOnyxProps>({
    preferredSkinTone: {
    key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
    initialValue: CONST.EMOJI_DEFAULT_SKIN_TONE,
    },

    // Avoid defining within component due to an existing Onyx bug
    preferredSkinTone={preferredSkinTone}

    And ReportActionItem use a memo to optimize the rendering, but we haven't consider the case for the preferred skin tone, so even after it's updated, the component never re-renders.

    memo(ReportActionItem, (prevProps, nextProps) => {
    const prevParentReportAction = prevProps.parentReportAction;
    const nextParentReportAction = nextProps.parentReportAction;
    return (
    prevProps.displayAsGroup === nextProps.displayAsGroup &&
    prevProps.isMostRecentIOUReportAction === nextProps.isMostRecentIOUReportAction &&
    prevProps.shouldDisplayNewMarker === nextProps.shouldDisplayNewMarker &&
    lodashIsEqual(prevProps.emojiReactions, nextProps.emojiReactions) &&
    lodashIsEqual(prevProps.action, nextProps.action) &&
    lodashIsEqual(prevProps.iouReport, nextProps.iouReport) &&
    lodashIsEqual(prevProps.report.pendingFields, nextProps.report.pendingFields) &&
    lodashIsEqual(prevProps.report.isDeletedParentAction, nextProps.report.isDeletedParentAction) &&
    lodashIsEqual(prevProps.report.errorFields, nextProps.report.errorFields) &&
    prevProps.report?.statusNum === nextProps.report?.statusNum &&
    prevProps.report?.stateNum === nextProps.report?.stateNum &&
    prevProps.report?.parentReportID === nextProps.report?.parentReportID &&
    prevProps.report?.parentReportActionID === nextProps.report?.parentReportActionID &&
    // TaskReport's created actions render the TaskView, which updates depending on certain fields in the TaskReport
    ReportUtils.isTaskReport(prevProps.report) === ReportUtils.isTaskReport(nextProps.report) &&
    prevProps.action.actionName === nextProps.action.actionName &&
    prevProps.report.reportName === nextProps.report.reportName &&
    prevProps.report.description === nextProps.report.description &&
    ReportUtils.isCompletedTaskReport(prevProps.report) === ReportUtils.isCompletedTaskReport(nextProps.report) &&
    prevProps.report.managerID === nextProps.report.managerID &&
    prevProps.shouldHideThreadDividerLine === nextProps.shouldHideThreadDividerLine &&
    prevProps.report?.total === nextProps.report?.total &&
    prevProps.report?.nonReimbursableTotal === nextProps.report?.nonReimbursableTotal &&
    prevProps.linkedReportActionID === nextProps.linkedReportActionID &&
    lodashIsEqual(prevProps.report.fieldList, nextProps.report.fieldList) &&
    lodashIsEqual(prevProps.policy, nextProps.policy) &&
    lodashIsEqual(prevProps.transactionThreadReport, nextProps.transactionThreadReport) &&
    lodashIsEqual(prevProps.reportActions, nextProps.reportActions) &&
    lodashIsEqual(prevProps.transaction, nextProps.transaction) &&
    lodashIsEqual(prevParentReportAction, nextParentReportAction)
    );

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

    Check for preferred skin tone in the memo.
    prevProps.preferredSkinTone === nextProps.preferredSkinTone &&.

    What alternative solutions did you explore? (Optional)

    Move the preferred skin tone onyx connection to edit composer component.

    as pointed out by the comment, the reason we pass the preferred skin tone from ReportActionItem to edit composer is because it causes a crash because the app tries to focus on the edit composer but it's not rendered yet because delayed by withOnyx (ref). However, I can't reproduce it anymore, but to be safe, we can set an initial value to it just like what we already did or use useOnxy to be safer.

  6. added
    External
    on May 13, 2024
  7. changed the title [-]mWeb - Chat - In edit comment, changed skin tone is not applied[/-] [+][$250] mWeb - Chat - In edit comment, changed skin tone is not applied[/+] on May 13, 2024
  8. melvin-bot commented on May 13, 2024

    @melvin-bot
  9. added
    Help Wanted
    on May 13, 2024
  10. melvin-bot commented on May 13, 2024

    @melvin-bot

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

  11. 9 remaining items

  12. bernhardoj commented on May 15, 2024

    @bernhardoj
    Contributor

    PR is ready

    cc: @s77rt

  13. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on May 27, 2024
  14. changed the title [-][$250] mWeb - Chat - In edit comment, changed skin tone is not applied[/-] [+][HOLD for payment 2024-06-03] [$250] mWeb - Chat - In edit comment, changed skin tone is not applied[/+] on May 27, 2024
  15. melvin-bot commented on May 27, 2024

    @melvin-bot

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

  16. removed
    Reviewing
    on May 27, 2024
  17. melvin-bot commented on May 27, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.75-1 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 2024-06-03. 🎊

    For reference, here are some details about the assignees on this issue:

  18. melvin-bot commented on May 27, 2024

    @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:

    • [@s77rt] The PR that introduced the bug has been identified. Link to the PR:
    • [@s77rt] 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:
    • [@s77rt] 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:
    • [@s77rt] Determine if we should create a regression test for this bug.
    • [@s77rt] 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.
    • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  19. s77rt commented on May 29, 2024

    @s77rt
    Member

    Regression Test Proposal

    1. Go to any report
    2. Send a message
    3. Right click (or long press) on the message and select "Edit comment"
    4. Type any emoji code e.g. :+1:
    5. Change the skin tone from the emoji picker button
    6. Type any emoji code e.g. :+1:
    7. Verify that newly inserted emoji has the updated skin tone color
  20. added
    Daily
    and removed
    Weekly
    on Jun 2, 2024
  21. garrettmknight commented on Jun 3, 2024

    @garrettmknight
    Contributor

    All paid up and QA'd, closing!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions