Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Jun 11, 2024 · 28 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 11, 2024

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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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.

@lanitochka17
Copy link
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

@sakluger
Copy link
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. 😄

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Jun 11, 2024
@melvin-bot melvin-bot bot 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 Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

Job added to Upwork: https://www.upwork.com/jobs/~014a67ec2b09731f24

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

@devguest07
Copy link
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.

@truph01
Copy link
Contributor

truph01 commented Jun 12, 2024

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.

@eh2077
Copy link
Contributor

eh2077 commented Jun 12, 2024

Thank you for your proposals!

@devguest07 Your proposal is close to success. You dived into the code and found a line to fix the effect, though that's not the best way to fix it. No worries, as you seem new to the project. Just a small tip for you: try to find out if there are similar existing coding patterns in the codebase when you're going to make changes. I believe you will soon land on a successful proposal.

@truph01 's proposal looks good to me. Their solution fixes both report and LHN message. More detail changes can be discussed in PR.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 12, 2024

Triggered auto assignment to @rlinoz, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@devguest07
Copy link
Contributor

Thank you @eh2077

@rlinoz
Copy link
Contributor

rlinoz commented Jun 13, 2024

Looks good, thanks!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

📣 @eh2077 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jun 13, 2024

📣 @truph01 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@eh2077
Copy link
Contributor

eh2077 commented Jun 14, 2024

@truph01 Kindly let us know when we can expect a PR to be ready for review, thanks!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jun 14, 2024
@truph01
Copy link
Contributor

truph01 commented Jun 14, 2024

@eh2077 I created PR #43765. It can be reviewed now.

@rlinoz
Copy link
Contributor

rlinoz commented Jun 25, 2024

@sakluger this issue was fixed by some other PR and is not reproducible anymore, but we had a working PR and all, can you proceed with payment to @truph01 and @eh2077 ?

@rlinoz rlinoz added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Jun 25, 2024
@melvin-bot melvin-bot bot added the Overdue label Jun 25, 2024
@sakluger
Copy link
Contributor

Summarizing payment on this issue:

Contributor: @truph01 $250, payable via Upwork
Contributor+: @eh2077 $250, paid via Upwork

@rlinoz
Copy link
Contributor

rlinoz commented Jun 25, 2024

Not sure why Melvin think this is overdue

@sakluger
Copy link
Contributor

@truph01 could you please apply to the job on Upwork (https://www.upwork.com/jobs/~014a67ec2b09731f24) or share your Upwork profile link so that we can pay you for your work and close out the GH issue? Thanks!

1 similar comment
@sakluger
Copy link
Contributor

@truph01 could you please apply to the job on Upwork (https://www.upwork.com/jobs/~014a67ec2b09731f24) or share your Upwork profile link so that we can pay you for your work and close out the GH issue? Thanks!

@rlinoz
Copy link
Contributor

rlinoz commented Jun 25, 2024

@sakluger I actually messed up and got things wrong, the main issue is still reproducible, and we are fixing it in the PR, I am really sorry about that.

@rlinoz rlinoz added Reviewing Has a PR in review and removed Awaiting Payment Auto-added when associated PR is deployed to production labels Jun 25, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jun 25, 2024
@rlinoz rlinoz added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Jun 28, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot 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 Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

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:

Copy link

melvin-bot bot commented Jul 3, 2024

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:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 4, 2024
@sakluger
Copy link
Contributor

sakluger commented Jul 8, 2024

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

@eh2077 can you please complete the BZ checklist?

@melvin-bot melvin-bot bot removed the Overdue label Jul 8, 2024
@truph01
Copy link
Contributor

truph01 commented Jul 9, 2024

@sakluger I accepted that offer, TY

@sakluger
Copy link
Contributor

Thanks, all paid!

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

@sakluger
Copy link
Contributor

Bump @eh2077

@eh2077
Copy link
Contributor

eh2077 commented Jul 13, 2024

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
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

6 participants