Skip to content

[HOLD for payment 2024-07-10] [$250] Chat - System message about adding tag in Parent: Child format shows Parent\: Child #43465

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.81-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Issue found when executing PR #43392

Action Performed:

  1. Go to URL https://staging.new.expensify.com/
  2. Log with any account
  3. Go to account settings -> Workspaces -> Create WS if needed
  4. Enabled Tags
  5. Add a tag in Parent: Child format
  6. Go to #admins room and check the system message

Expected Result:

System message about adding tag in Parent: Child format shows as Parent: Child, not Parent\: Child

Actual Result:

System message about adding tag in Parent: Child format shows Parent\: Child

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

227

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014a67ec2b09731f24
  • Upwork Job ID: 1800543159428158713
  • Last Price Increase: 2024-06-11
  • Automatic offers:
    • eh2077 | Reviewer | 102720454
Issue OwnerCurrent Issue Owner: @eh2077

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 11, 2024
  2. melvin-bot commented on Jun 11, 2024

    @melvin-bot

    Triggered auto assignment to @sakluger (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 Jun 11, 2024

    @lanitochka17
    Author

    @sakluger 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. sakluger commented on Jun 11, 2024

    @sakluger
    Contributor

    FYI @lanitochka17 - GitHub was removing the \ from your comment because it's a Markdown formatting character in GH - it's an escape character used to ignore other markdown formatting (more details here).

    I updated your comment to add that character back. 😄

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 11, 2024
  6. changed the title [-]Chat - System message about adding tag in Parent: Child format shows Parent\: Child[/-] [+][$250] Chat - System message about adding tag in Parent: Child format shows Parent\: Child[/+] on Jun 11, 2024
  7. melvin-bot commented on Jun 11, 2024

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 11, 2024
  9. melvin-bot commented on Jun 11, 2024

    @melvin-bot

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

  10. devguest07 commented on Jun 11, 2024

    @devguest07
    Contributor

    Proposal

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

    System message about adding tag in Parent: Child format shows Parent: Child

    What is the root cause of that problem?

    When displaying messages inside ReportActionItemFragment and TextCommentFragment, we do not clean the tag message escaping of colons (used to create multi-level tags, e.g., "Parent: Child") in the tag name received from the backend.

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

    We need to clean up the message from the colons before displaying it. This can be done at multiple levels before being displayed. One way is by editing the fragment inside ReportActionItemFragment.

    actionName,
    fragment,

    We can use if (actionName === 'POLICYCHANGELOG_ADD_TAG') to check if it's a tag message. If so, we can use the utility PolicyUtils.getCleanedTagName to return a clean tag message.

    if (actionName === 'POLICYCHANGELOG_ADD_TAG') {
      tagFragment = PolicyUtils.getCleanedTagName(fragment.html); // we can use fragment.text too
    }

    If we have a new value, we can display it and pass it to the component TextCommentFragment.

  11. truph01 commented on Jun 12, 2024

    @truph01
    Contributor

    Proposal

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

    • System message about adding tag in Parent: Child format shows Parent: Child

    What is the root cause of that problem?

    • With the system message about adding tag, BE returns a message like:
    {
        "actionName": "POLICYCHANGELOG_ADD_TAG",
        "message": [
            {
                "html": "added the tag \"name\\: age\" to the list \"Tag\"",
                "text": "added the tag \"name\\: age\" to the list \"Tag\""
            }
        ]
    }
    
    

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

     else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAG){
                children = <ReportActionItemBasicMessage message={PolicyUtils.getCleanedTagName(action.message?.[0]?.text ?? '')} />;
    
    else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAG) {
                result.alternateText = PolicyUtils.getCleanedTagName(lastAction?.message?.[0]?.text ?? '');
    

    to fix the LHN issue.

    What alternative solutions did you explore? (Optional)

    • There are a few component where we have the same issue, for example, copy to clipboard action and we need to address them as well.
  12. 29 remaining items

  13. changed the title [-][$250] Chat - System message about adding tag in Parent: Child format shows Parent\: Child[/-] [+][HOLD for payment 2024-07-10] [$250] Chat - System message about adding tag in Parent: Child format shows Parent\: Child[/+] on Jul 3, 2024
  14. melvin-bot commented on Jul 3, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 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-07-10. 🎊

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

  15. melvin-bot commented on Jul 3, 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:

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

    @sakluger
    Contributor

    I sent an offer to @truph01 via Upwork: https://www.upwork.com/nx/wm/offer/103034403.

    @eh2077 can you please complete the BZ checklist?

  17. truph01 commented on Jul 9, 2024

    @truph01
    Contributor

    @sakluger I accepted that offer, TY

  18. sakluger commented on Jul 10, 2024

    @sakluger
    Contributor

    Thanks, all paid!

    @eh2077 we're just holding for the BZ checklist before we can close this issue.

  19. sakluger commented on Jul 11, 2024

    @sakluger
    Contributor

    Bump @eh2077

  20. eh2077 commented on Jul 13, 2024

    @eh2077
    Contributor

    Checklist

    • [@eh2077] The PR that introduced the bug has been identified. Link to the PR: There's not such PR that causes this bug because the system message is from backend.
    • [@eh2077] 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: N/A
    • [@eh2077] 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
    • [@eh2077] Determine if we should create a regression test for this bug. No

    cc @sakluger

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions